Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: In Love - MUSC 115 Final
name
code content
//In Love - MUSC 115 Final //Lydia Davidson //Samples a = Buffer.read(s, "/Applications/Audacity/Angels Intro.wav"); b = Buffer.read(s, "/Applications/Audacity/As In Love.wav"); c = Buffer.read(s, "/Applications/Audacity/Beat And Leaving.wav"); a.play; b.play; c.play; // SynthDefs ( // simple synthdef, no filters or effects, just env and panning control SynthDef("granny1", {arg rate = 1, amp = 1, buffer, startPos = 0, attack = 0.02, release = 0.5, panning = 0; var snd, env; env = Env.perc(attackTime: attack, releaseTime: release, level: amp).kr(doneAction: 2); snd = PlayBuf.ar( numChannels: 1, bufnum: buffer, rate: rate, startPos: startPos.linlin(0, 1, 0, BufFrames.kr(buffer)) ); snd = snd * env; snd = Pan2.ar(snd, panning); Out.ar(0, snd); }).add; // Same as above, but adding a filter just for fun SynthDef("granny2", {arg rate = 1, amp = 1, buffer, startPos = 0, attack = 0.02, release = 0.5, ffreq = 1000, rq = 0.1, panning = 0; var snd, env; env = Env.perc(attackTime: attack, releaseTime: release, level: amp).kr(doneAction: 2); snd = PlayBuf.ar( numChannels: 1, bufnum: buffer, rate: rate, startPos: startPos.linlin(0, 1, 0, BufFrames.kr(buffer)) ); snd = snd * env; snd = BPF.ar(snd, ffreq, rq); snd = Pan2.ar(snd, panning); Out.ar(0, snd); }).add; // Same as above, but adding an echo effect (CombC) SynthDef("granny3", {arg rate = 1, amp = 1, buffer, startPos = 0, attack = 0.02, release = 0.5, ffreq = 1000, rq = 0.1, panning = 0, delay = 0.3, decay = 1; var snd, env; env = Env.perc(attackTime: attack, releaseTime: release, level: amp).kr(doneAction: 2); snd = PlayBuf.ar( numChannels: 1, bufnum: buffer, rate: rate, startPos: startPos.linlin(0, 1, 0, BufFrames.kr(buffer)) ); snd = snd * env; snd = BPF.ar(snd, ffreq, rq); snd = CombC.ar(snd, maxdelaytime: 2, delaytime: delay, decaytime: decay); snd = Pan2.ar(snd, panning); Out.ar(0, snd); }).add; SynthDef("hihat", {arg out = 0, amp = 0.5, att = 0.01, rel = 0.2, ffreq = 6000, pan = 0; var env, snd; env = Env.perc(att, rel, amp).kr(doneAction: 2); snd = WhiteNoise.ar; snd = HPF.ar(in: snd, freq: ffreq, mul: env); Out.ar(out, Pan2.ar(snd, pan)); }).add; 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("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("sawSynth", { arg freq = 440, amp = 0.1, att = 0.1, rel = 2, lofreq = 1000, hifreq = 3000; var env, snd; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(doneAction: 2); snd = Saw.ar(freq: freq * [0.99, 1, 1.001, 1.008], mul: env); snd = LPF.ar( in: snd, freq: LFNoise2.kr(1).range(lofreq, hifreq) ); snd = Splay.ar(snd); Out.ar(0, snd); }).add; ) //Pbinds ( ~shhh = Pbind( \instrument, "snare", \dur, 1/30, \att, 0.5, \rel, 0.01, \sinfreq, 25000, \ffreq, 15000, \amp, Pseg( Pseq([0.005, 0.1],inf), Pseq([7, 15], 1), \linear) ); ~shhh2 = Pbind( \instrument, "snare", \dur, 1/30, \att, 0.5, \rel, 0.01, \sinfreq, 25000, \ffreq, 15000, \amp, Pseg( Pseq([0.005, 0.01],inf), Pseq([7, 10], 1), \linear) ); ~atmosphereAmp = 1; // 1 does not change anything ~atmosphere = Pbind( \instrument, "granny2", \rate, 2, \amp, 0.8 * Pfunc({~atmosphereAmp}), \startPos, 0, \attack, 0.5, \release, 10, \ffreq, 10000, \rq, 0.05, \buffer, a, \dur, 1, ); ~atmosphere2Amp = 1; ~atmosphere2 = Pbind( \instrument, "granny2", \rate, 4, \amp, 0.9 * Pfunc({~atmosphere2Amp}), \startPos, 0, \attack, 1, \release, 6, \ffreq, 15000, \rq, 0.02, \buffer, a, \dur, 2, ); ~intro = Pbind( \instrument, "granny1", \rate, 2, \amp, Pseq([Pn(0.04, 5), 0.05, 0.06, 0.06, 0.07, 0.07, 0.08, 0.09, 0.09, 0.09, 0.1]), \startPos, 0.25, \attack, 3.5, \release, 0.5, \buffer, a, \dur, 1, ); ~introsh = Pbind( \instrument, "granny1", \rate, 2, \amp, Pseq([Pn(0.04, 3), 0.03, 0.02, 0.01, 0.007, 0.002]), \startPos, 0.25, \attack, 6, \release, 1, \buffer, a, \dur, 1, ); ~intro2 = Pbind( \instrument, "granny1", \rate, 2, \amp, 0.1, \startPos, 0.45, \attack, 1, \release, 1, \buffer, a, \dur, 1, ); ~inLove = Pbind( \instrument, "granny1", \rate, Pseq([4, 2, 1]), \amp, Pseq([0.15, 0.25, 0.5]), \startPos, 0.10, \attack, 5, \release, Prand([6, 7, 8, 9, 10], 3), \buffer, b, \dur, Pseq([0.5, 1, 1.5]), \panning, Pwhite(-1, 1.0); ); ~inLove2 = Pbind( \instrument, "granny1", \rate, Pseq([2, 2, 1, 1, 1, 1, 1, 1, 1], 3), \amp, 0.05, \startPos, 0.10, \attack, 0.7, \release, 0.7, \buffer, b, \dur, Pseq([0.5, Rest, 0.5, 0.5, 0.5, 0.5, 0.5, Rest, 0.5]), \panning, Pwhite(-1, 1.0); ); ~love = Pbind( \instrument, "granny1", \rate, 2, \amp, 0.025, \startPos, 0.17, \attack, 0.5, \release, 1, \buffer, b, \dur, Pseq([0.5, Rest, 0.5]), \panning, Pwhite(-1, 1.0); ); ~ch = Pbind( \instrument, "granny2", // notice I'm using granny2 synthdef here \rate, 1, \amp, 1, // boosted to 5 because filtering attenuates a lot of the sound \startPos, Pseq([0.4, 0.93, 0.7, 0.9], inf), \attack, 0.02, \release, 0.4, \ffreq, 6500, \rq, 0.02, \buffer, c, // which buffer to play from \dur, 0.03, \panning, Pwhite(-0.5, 0.5) ); ~bass = Pbind( \instrument, "granny1", \rate, 0.5, \amp, 0.08, \startPos, 0.3, \attack, 0.02, \release, 1, \buffer, c, \dur, 0.25, \panning, 0; ); ~prevoiceAmp = 1; ~prevoice = Pbind( \instrument, "granny3", \rate, 2, \amp, 0.5 * Pfunc({~prevoiceAmp}), \startPos, Pseq([0.25, 0.15, 0.67, 0.9, 0.87], 2), \attack, 1, \release, 0.6, \ffreq, 700, \rq, 0.05, \delay, 0.2, \decay, 2, \buffer, b, \dur, 0.5, \panning, Pwhite(-0.5, 0.5) ); ~prevoice2Amp = 1; ~prevoice2 = Pbind( \instrument, "granny3", \rate, Pseq([8, 4, 2], 3), \amp, 0.5 * Pfunc({~prevoice2Amp}), \startPos, Pseq([0.25, 0.15, 0.67, 0.9, 0.87], 3), \attack, 1, \release, 0.6, \ffreq, 700, \rq, 0.05, \delay, 0.2, \decay, 2, \buffer, b, \dur, 0.5, \panning, Pwhite(-0.5, 0.5) ); ~kick = Pbind( \instrument, "kick", \dur, 0.25, \att, 0.002, \rel, 0.12, \sinfreq, 30, \glissf, 0.5, \amp, 0.5, ); ~kick2 = Pbind( \instrument, "kick", \dur, Pseq([0.25, Rest(0.75)], inf), \att, 0.002, \rel, 0.12, \sinfreq, 80, \glissf, 0.5, \amp, 0.5, ); ~kick3 = Pbind( \instrument, "kick", \dur, 0.5, \att, 0.002, \rel, 0.12, \sinfreq, 20, \glissf, 0.5, \amp, 0.5, ); ~kick4 = Pbind( \instrument, "kick", \dur, 2, \att, 0.02, \rel, 0.05, \sinfreq, 90, \glissf, 0.5, \amp, 0.5, ); ) // ================================= // Putting stuff together with Pspawner // ================================= t = TempoClock(58/60); ( t = TempoClock(58/60); Pspawner({ arg maestro; maestro.par(~shhh); 6.wait; ~player = maestro.par(~atmosphere2); 6.5.wait; ~player0 = maestro.par(~atmosphere); 10.wait; ~player1 = maestro.par(~intro); 8.wait; maestro.suspend(~player); ~player2 = maestro.par(~bass); 1.wait; maestro.suspend(~player1); ~player5 = maestro.par(~intro2); 3.wait; ~player3 = maestro.par(~ch); ~player4 = maestro.par(~kick); 4.wait; ~player7 = maestro.par(~kick2); 4.wait; ~player8 = maestro.par(~kick3); 2.wait; ~player9 = maestro.par(~kick4); maestro.seq(~prevoice); 1.wait; maestro.seq(~prevoice2); maestro.suspend(~player8); 2.wait; maestro.par(~prevoice); 2.wait; maestro.par(~prevoice2); 2.wait; maestro.par(~prevoice2); 1.wait; maestro.par(~prevoice); maestro.par(~inLove2); 4.wait; ~player6 = maestro.par(~intro); maestro.par(~inLove2); 3.wait; maestro.par(~inLove); 2.5.wait; maestro.suspend(~player2); maestro.suspend(~player7); maestro.suspend(~player3); maestro.suspend(~player4); maestro.suspend(~player9); maestro.par(~inLove); 2.wait; maestro.suspend(~player6); 3.wait; maestro.suspend(~player5); maestro.par(~atmosphere2); 6.wait; ~player1 = maestro.par(~intro); 5.wait; ~player8 = maestro.par(~kick3); 3.wait; maestro.par(~shhh2); 3.wait; maestro.par(~prevoice); 2.wait; maestro.par(~prevoice2); 2.wait; maestro.suspend(~player8); 2.wait; maestro.seq(~love); maestro.seq(~introsh); 5.wait; maestro.suspendAll; }).play(t); )
code description
samples: https://drive.google.com/open?id=0B4lYb-DVaMMLekk4Y0JiSlkwbGM https://soundcloud.com/lydia-davidson-919585173/in-love-musc-115-final
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