Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: "Home" - MUSC 115 Final
name
code content
/* Note: 1) download samples and change path 2) run blocks in order: "samples", "synthdefs", "pbinds", "sequence" 3) preferably kill/reboot server and then run to avoid distortion */ ///////////////// /// SAMPLES /// /////////////// ( b = Buffer.readChannel(server: s, path: "/Users/tanyasonker/Downloads/Tabla.wav", channels: [0]); c = Buffer.readChannel(server: s, path: "/Users/tanyasonker/Downloads/good-morning-RJ-voiceover.wav", channels: [0]); d = Buffer.readChannel(server: s, path: "/Users/tanyasonker/Downloads/Tabla2.wav", channels: [0]); e = Buffer.readChannel(server: s, path: "/Users/tanyasonker/Downloads/sigh.wav", channels: [0]); ) ///////////////// /// SYNTHDEFS /// ///////////////// ( SynthDef("grain-asr", {arg buffer, rate = 1, startPos = 0, gate = 1, att = 0.01, rel = 0.1, amp = 1, pan = 0; var env, snd; env = Env.asr(att, amp, rel).kr(gate: gate, doneAction: 2); snd = PlayBuf.ar(1, buffer, rate: rate, startPos: startPos * BufSamples.kr(buffer)); snd = snd * env; Out.ar(0, Pan2.ar(snd, pan)); }).add; SynthDef("fm2_a", {arg freq = 440, modindex = 10, amp = 0.1, pos = 0, gate = 1, att = 0.01, rel = 0.3; var carrier, modulator, freqdev, env, modfreq; modindex = Line.kr(modindex, 1, att); modfreq = freq / 2; freqdev = modfreq * modindex; modulator = Pulse.ar(freq: modfreq, mul: freqdev); carrier = SinOsc.ar(freq: [freq + modulator, freq * 1.011 + modulator]); carrier = carrier + SinOsc.ar(freq: [freq + modulator, freq * 1.011 + modulator] * 1/2); env = Env.asr( attackTime: att, sustainLevel: amp, releaseTime: rel ).kr(doneAction: 2, gate: gate); carrier = carrier + FreeVerb.ar(in: carrier, mix: 0.33, room: 0.75, damp: 0.25, mul: 1, add: 0); carrier = Pan2.ar(in: carrier, pos: pos, level: env); Out.ar(0, carrier * amp); }).add; //plugin: MdaPiano SynthDef("chords1", { |out=0, freq=440, gate=1, amp=0.5, att=0.1, rel=0.01| var env = Env.adsr( attackTime: 0.01, decayTime: att, releaseTime: rel).kr(doneAction: 2); var snd = MdaPiano.ar(freq: [freq, freq], gate: gate, release: 0, tune: 0.9, stereo: 0.3, sustain: 0, mul: env * 1/2); DetectSilence.ar(snd, 0.01); Out.ar(out, snd * 0.5); }).add; SynthDef("chords2", { |out=0, freq=440, gate=1, amp=0.5, att=0.1, rel=0.01| var env = Env.adsr( attackTime: 0.01, decayTime: att, releaseTime: rel).kr(doneAction: 2); var snd = MdaPiano.ar(freq: [freq, freq], gate: gate, release: 0, tune: 0.7, stereo: 0.3, sustain: 0, mul: env * amp); DetectSilence.ar(snd, 0.01); Out.ar(out, snd * amp); }).add; //drumkit adapted from: http://sccode.org/1-54H SynthDef("snare", {arg out = 0, amp = 0.1, sinfreq = 180, att = 0.01, rel = 0.2, ffreq = 2000, pan = 0; var env, snd1, snd2, sum; env = Env.perc(att, rel, amp).kr(doneAction: 2); snd1 = HPF.ar( in: WhiteNoise.ar, freq: ffreq, mul: env ); snd2 = SinOsc.ar(freq: sinfreq, mul: env); sum = snd1 + snd2; Out.ar(out, Pan2.ar(sum, pan)); }).add; SynthDef("kick", {arg out = 0, amp = 0.3, sinfreq = 60, glissf = 0.9, att = 0.01, rel = 0.45, pan = 0; var env, snd, ramp; env = Env.perc(att, rel, amp).kr(doneAction: 2); ramp = XLine.kr( start: sinfreq, end: sinfreq * glissf, dur: rel ); snd = SinOsc.ar(freq: ramp, mul: env); snd = Pan2.ar(snd, pan); Out.ar(out, snd); }).add; SynthDef("am1_b", {arg freq = 440, modfreq = 2, amp = 0.2, att = 0.01, rel = 3, out = 0, pan = 0; var carrier, modulator, env; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(2); modulator = LFSaw.ar(modfreq).range(0, 1); carrier = LFTri.ar(freq: [freq * 0.25, freq * 0.15], mul: env * modulator * 10); carrier = Pan2.ar(in: carrier, pos: pan); Out.ar(out, carrier); }).add; SynthDef("am1_a", {arg freq = 440, modfreq = 2, amp = 0.2, att = 0.01, rel = 3, out = 0, pan = 0; var carrier, modulator, env; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(2); modulator = SinOsc.ar(modfreq).range(0, 1); carrier = SinOsc.ar(freq: [freq * 1.15, freq * 0.35], mul: env * modulator * 10); carrier = Pan2.ar(in: carrier, pos: pan); Out.ar(out, carrier * amp); }).add; SynthDef("waves", { arg dur = 1, amp = 0.5; var env = Env.pairs([[0,0], [0.4, 1], [1, 0.2], [1.1, 0.5], [1.5, 0.2], [2, 0.5], [2.4, 0.7], [3.5, 0], [4, 1], [4.5, 0.7], [5, 0.8],[5.5, 0.3], [6, 0.5], [9, 0]], \lin); var snd = Splay.ar(PinkNoise.ar([440, 442], mul: env.kr(doneAction: 2) * amp)); Out.ar(0, snd); }).add; ) ///////////////// /// PBINDS /// ///////////////// ( ~bass = Pbind( \instrument, "fm2_a", \midinote, Pseq([ [39, 46], [34, 41], [36, 43], [32, 39], [39, 46], [34, 41], [36, 43], [32, 39], 39, 46, 34, 41, 36, 43, 32, 39, 39, 46, 34 ], 1), \dur, Pseq([ Pn(Pseq([1.5, 2, 2, 2]), 2), Pn(2, 26)] * 1.5), \ctranspose, 12, \att, 0.01, \rel, 0.01, \amp, 0.1 ); ~chords = Pbind( \instrument, "chords2", \midinote,Pseq([ Pn(Pseq([63, 63, 70, 67, 65]), 3), 72, 67, 65, 63, 63, 68, 68, 68, Pn(Pseq([63, 63, 70, 67, 65]), 2), 72, 67, 65, 63, 63, 68, 68, 68, Pn(70, 4), 67, Pn(70, 4), 75, 74, 72, Pn(67, 5), Pn(68, 5), Pn(67, 2), Pn(75, 5), Pn(74, 5), 72, Pn(67, 5), Pn(68, 5), 67, 70, 63, 62, Pn(67, 2), 70, 62, 60, Pn(67, 5), Pn(68, 5), Pn(67, 4), 70, 63, 62, Pn(67, 2), 70, 62, 60, Pn(67, 5), Pn(68, 5), Pn(63, 2) ]), \dur, Pseq([ Pn(Pseq([0.5, 0.5, 2, 1, 0.5]), 3), 1.5, 1.5, Pn(0.5, 3), Pn(1, 3), Pn(Pseq([0.5, 0.5, 2, 1, 0.5]), 2), 1.5, 1.5, Pn(0.5, 3), Pn(1, 3), Pn(1/2, 3), 1, 1/2, 1, Pn(1/2, 3), Pn(1/2, 2), 1, Pn(1/2, 3), Pn(1, 2), 1, Pn(1/2, 3), 1, Pn(1, 2), Pn(1/2, 3), Pn(1, 2), 1, Pn(1/2, 3), Pn(1, 2), 1, Pn(1/2, 3), Pn(1, 2), Pn(1/2, 3), Pn(1, 2), Pn(1/2, 3), 1, Pn(1/2, 1), 1, 1/2, 1, Pn(1/2, 3), Pn(1, 2), 1, Pn(1/2, 3), 1, 1, 2, Pn(1/2, 2), Pn(1/2, 2), 2, Pn(1/2, 5), Pn(1/2, 3), Pn(1, 2), 1, Pn(1/2, 4), 1/2, 4 ] * 0.6), \ctranspose, 12, \att, 0.01, \rel, 0.1, \amp, 0.3 ); ~snare = Pbind( \instrument, "snare", \dur, Pseq([Rest(1), 1/2, Rest(1.7), 1/2], 7), \att, 0.01, \rel, 0.1, \sinfreq, 180, \ffreq, 3000, \amp, 0.2 ); ~kick = Pbind( \instrument, "kick", \dur, Pseq([1/2, 1/2, Rest(1/2), 1, 1/2, Rest(0.7)], 7), \att, 0.01, \rel, 0.22, \sinfreq, 120, \glissf, 0.5, \amp, 0.6, ); ~tabla1 = Pbind( \instrument, "grain-asr", \buffer, b, \startPos, 0, \dur, 4, \rate, Pn(1, 1), \amp, 0.7, ); ~tabla2 = Pbind( \instrument, "grain-asr", \buffer, d, \startPos, 0, \dur, 3.5, \rate, Pn(1, 1), \amp, 0.7, ); ~radio = Pbind( \instrument, "grain-asr", \buffer, c, \startPos, 0, \dur, 6, \rate, Pn(1, 1), \amp, 0.1, ); ~temple = Pbind( \instrument, "grain-asr", \buffer, b, \startPos, Pwhite(0.10, 0.15), \dur, 1/2, \att, 0.31, \rel, 0.5, \rate, Pseq([1, 5, 3, 3.3], 3), \amp, Pwhite(0.02, 0.95), \pan, Pwhite(-1.0, 1.0), \legato, Pn(Pgeom(0.1, 1.05, 40)) ); ~alarm1 = Pbind( \instrument, "am1_b", \freq, Pwhite(700, 705), \dur, Pseq([Pn(0.1, 5), 0.2], 4), \amp, Pwhite(0.15, 0.2) * 0.2, \att, 0.01, \rel, 0.1, \modfreq, Pwhite(10, 30), \pos, 0 ); ~alarm2 = Pbind( \instrument, "am1_a", \freq, Pwhite(700, 705), \dur, Pseq([Pn(0.12, 5), 0.2], 4), \amp, Pwhite(0.15, 0.2), \att, 0.01, \rel, 0.1, \modfreq, Pwhite(10, 30), \pos, 0 ); ~snooze = Pbind( \instrument, "snare", \dur, Pn(1, 1), \att, 0.01, \rel, 0.1, \sinfreq, 80, \ffreq, 100, \amp, 0.2 ); ~waves = Pbind( \instrument, "waves", \dur, Pn(12, 1), \amp, 0.4 ); ~sigh = Pbind( \instrument, "grain-asr", \buffer, e, \startPos, 0.1, \dur, 3, \rate, Pn(1, 1), \amp, 0.1, ); ) ///////////////// /// SEQUENCE /// ///////////////// ( t = TempoClock(60/60); s = TempoClock(94/60); { ~alarm1.play(t); 3.5.wait(t); ~snooze.play(t); 1.wait(t); ~temple.play(t); 6.wait(t); ~waves.play(t); 8.wait(t); ~radio.play(t); 4.wait(t); ~chords.play(t); 1.25.wait(t); ~bass.play(t); 6.wait(t); ~snare.play(s); ~kick.play(s); 17.5.wait(t); ~tabla1.play(t); 4.wait(t); ~tabla2.play(t); 4.wait(t); ~tabla2.play(t); 4.wait(t); ~tabla2.play(t); 4.wait(t); ~tabla1.play(t); 3.wait(t); ~tabla1.play(t); 3.wait(t); ~tabla1.play(t); 4.wait(t); ~tabla2.play(t); 10.wait(t); ~alarm2.play(t); 4.wait(t); ~snooze.play(t); 1.wait(t); ~sigh.play(t); }.fork(t); ) ///////////////// /// SAMPLES /// /// SOURCES /// /////////////// /* Tabla: 1) https://www.looperman.com/loops/detail/135386/indian-tabla-68-another-pattern-68bpm-trap-tabla-loop 2) https://www.looperman.com/loops/detail/137303/tabla-pattern-68bpm-trap-tabla-loop RJ Voice over: https://soundcloud.com/user808720009/lage-raho-munna-bhai-good Sigh: http://soundbible.com/132-Female-Sigh.html */
code description
Soundscape inspired partly by the festive season of Ganesh Chaturthi but mostly by homesickness. (Melody: Imagine Dragon's "Demons") SoundCloud: https://soundcloud.com/tanya-sonker/musc-115-final-home/s-wYqGN Samples: https://drive.google.com/drive/folders/1l6YHKmooAtkYTsJgvGV0nQZFeAg8CHiv?usp=sharing
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change