Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Wind Down: Track Creation Project
name
code content
//By: Patrick Kirk ///////////////// /// SYNTHDEFS /// ///////////////// //Evaluate all and track should play ( SynthDef("windSaw", {arg freq = 85, att = 0.001, amp = 0.3, maxOsc = 20, loOsc = 5, rel = 5, maxAmp = 0.6, loAmp = 0.1, gate = 1; var snd, env; env = Env.adsr( attackTime: att, decayTime: 3, sustainLevel: 0.75, releaseTime: rel, peakLevel: amp ).kr(doneAction: 2, gate: gate); snd = LFSaw.ar( freq: freq*[2, 3, 4], mul: env*SinOsc.kr(freq: XLine.kr(maxOsc, loOsc, 5).range(maxAmp, loAmp))); snd = snd + LFTri.ar( freq: freq*6, mul: env*SinOsc.kr(freq: XLine.kr(maxOsc, loOsc, 5).range(maxAmp, loAmp))); snd = Splay.ar(snd); Out.ar(0, snd); }).add; SynthDef("whiteUp", { arg amp = 0.8, dur = 16.8; var snd, env; env = Env.perc( attackTime: dur, releaseTime: 0.01, level: amp, curve: 4 ).kr(doneAction: 2); snd = WhiteNoise.ar(env*SinOsc.kr(XLine.kr(8, 1, dur)).range(0.2, 0.8)) + PinkNoise.ar(2*env*SinOsc.kr(XLine.kr(16, 8, dur)).range(0.2, 0.8)); snd = Splay.ar(snd); Out.ar(0, snd); }).add; SynthDef("whiteDown", { arg amp = 0.5; var snd, env; env = Env.perc( attackTime: 0.01, releaseTime: 4, level: amp, curve: 2 ).kr(doneAction: 2); snd = WhiteNoise.ar(env*SinOsc.kr(XLine.kr(1, 8, 8)).range(0.2, 0.8)); snd = Splay.ar(snd); Out.ar(0, snd); }).add; SynthDef("sawSynth", { arg freq = 440, amp = 0.1, att = 0.001, rel = 0.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; SynthDef("snare", {arg out = 0, amp = 0.3, sinFreq = 180, att = 0.01, rel = 0.2, ffreq = 2000, pan = 0; var env, env2, snd1, snd2, snd3, sum; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(doneAction: 2); env2 = Env.perc( attackTime: 0.001, releaseTime: 0.02, level: amp*1.3 ).kr(doneAction: 2); snd1 = HPF.ar( in: WhiteNoise.ar, freq: ffreq, mul: env ); snd2 = SinOsc.ar(freq: sinFreq, mul: env); snd3 = LPF.ar( in: FSinOsc.ar(300), freq: 12000, mul: env ); sum = snd1 + snd2 + snd3; Out.ar(out, Pan2.ar(sum, pan)); }).add; SynthDef("tom", {arg out = 0, amp = 0.3, sinFreq = 180, att = 0.01, rel = 0.2, ffreq = 2000, pan = 0; var env, env2, snd1, snd2, snd3, sum; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(doneAction: 2); env2 = Env.perc( attackTime: 0.001, releaseTime: 0.02, level: amp*1.3 ).kr(doneAction: 2); snd1 = HPF.ar( in: WhiteNoise.ar, freq: ffreq, mul: env ); snd2 = SinOsc.ar(freq: sinFreq, mul: env); snd3 = LPF.ar( in: FSinOsc.ar([500, 600, 700]), freq: 12000, mul: env ); sum = snd1 + snd2 + snd3; Out.ar(out, Pan2.ar(sum, pan)); }).add; SynthDef("hihat", {arg amp = 0.5, att = 0.01, rel = 0.3, ffreq = 6000, idk = 300, pan = 0; var env, env2, snd, snd2, sum; env = EnvGen.kr(Env.perc(0, 0.01), doneAction: 2); env2 = EnvGen.kr(Env.perc( attackTime: att, releaseTime: rel, level: amp), doneAction: 2); snd = WhiteNoise.ar; snd = HPF.ar(in: snd, freq: ffreq, mul: env); snd2 = HPF.ar( in: FSinOsc.ar(idk), freq: 1000, mul: env2 ); sum = snd + snd2; Out.ar(0, Pan2.ar(sum, pan)); }).add; SynthDef("bazz", {arg freq=60, amp=0.01, att = 0.025, dec = 0.6, rel = 0.5, crunchy = 200, gate=1; var snd, env, snd2, sum; env = Env.adsr(attackTime: att, decayTime: dec, sustainLevel: 0.5, releaseTime: rel).kr(2, gate); env = env/3; snd = LFSaw.ar(freq: SinOsc.kr(XLine.kr(7, 2, 1)).range(freq, freq/2), mul: env/2) + LFSaw.ar(freq: freq, mul: env) + LFTri.ar(freq: freq*[3], mul: env/2) + SinOsc.ar(freq: freq*[2, 4, 6], mul: env); snd = LPF.ar( in: snd, freq: XLine.kr(10000, crunchy, att*5) ); sum = snd; sum = Splay.ar(sum); Out.ar(0, sum); }).add; //mostly adapted from an FM synthdef by Schemawound: http://sccode.org/1-4Tq SynthDef("FM", {|out = 0, gate = 1, amp = 1, carFreq = 500, modFreq = 50, modAmount = 2000, clipAmount = 0.1| var env, snd, car, ampEnv, clip; env = EnvGen.ar(Env.adsr(0.5, 0.5, 0.7, 0.1, peakLevel: modAmount), gate); snd = SinOsc.ar(modFreq) * env; car = SinOsc.ar(carFreq + snd); ampEnv = EnvGen.ar(Env.adsr(0.1, 0.3, 0.7, 0.2, peakLevel: amp), gate, doneAction: 2); clip = clipAmount * 300; snd = (car * ampEnv * clip).clip(-0.7, 0.7); snd = Splay.ar(snd); Out.ar(out, snd* 0.1); }).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("kickKnock", {arg out = 0, pan = 0, amp = 0.3; var main, mainFreq, mainAmp; var pop, popFreq, popAmp; var click, clickAmp; var snd; mainFreq = EnvGen.ar(Env([261, 120, 51], [0.035, 0.08], curve: \exp)); mainAmp = EnvGen.ar(Env.linen(0.005, 0.1, 0.3), doneAction: 2); main = SinOsc.ar(mainFreq) * mainAmp; popFreq = XLine.kr(750, 261, 0.02); popAmp = EnvGen.ar(Env.linen(0.001, 0.02, 0.001)) * 0.15; pop = SinOsc.ar(popFreq) * popAmp; clickAmp = EnvGen.ar(Env.perc(0.001, 0.01)) * 0.15; click = LPF.ar(Formant.ar(910, 4760, 2110), 3140) * clickAmp; snd = main + pop + click; snd = snd.tanh; Out.ar(out, Pan2.ar(snd, pan, amp)); }).add; ////////////// /// PBINDS /// ////////////// //in order of appearance ~tinkle = Pbind( \instrument, "hihat", \dur, Pseq([1/4, Rest(1/4)], inf), \att, 0.001, \rel, 0.1, \idk, Pn(Pgeom(300, 1.5, 8.4), inf), \amp, 0.45, \tempo, 126/60 );//I meant for this to be a hi hat but it turned to be something different but better ~softBuild = Pbind( \instrument, "sawSynth", \midinote, Pseq([Pseq([60, 63, 67, 70, 74], 1), Rest(1), Pseq([60, 63, 67, 70, 74].reverse, 1), Rest(1)], 10), \att, 0.001, \rel, Pgeom(0.1, 1.07, 100), \dur, 1/4, \tempo, 126/60 ); ~kickIntro = Pbind( \instrument, "kick", \dur, Pseq([Pn(1, 16), Pn(1/2, 16), Pn(1/4, 32)], 1), \amp, Pseq([Pgeom(0.1, 1.15, 8.4), Pn(0.6, inf)], 1), \tempo, 126/60 ); ~sawBuild = Pbind( \instrument, "sawSynth", \freq, Pseq([Pgeom(600, 1.01, 15), Pgeom(625, 1.015, 15), Pgeom(650, 1.02, 15), Pgeom(675, 1.025, 15)], inf), \dur, Pseq([Pn(1/4,14), Rest(1/2)], inf), \hifreq, 4000, \amp, Pn(Pgeom(0.05, 1.05, 15), inf)*Pstutter(15, Pgeom(1, 1.3, 8)), \tempo, 126/60 ); ~whiteUp = Pbind( \instrument, "whiteUp", \dur, Pseq([17], 1), \amp, 0.5, \tempo, 126/60 ); ~windDown = Pbind( \instrument, "windSaw", \freq, Pn(60, inf), \dur, Pn(Pseq([12, Rest(20)], 1), inf), \amp, 0.2, \tempo, 126/60 ); ~kick = Pbind( \instrument, "kickKnock", \dur, Pseq([Pn(1, 30), Rest(2)], inf), \att, 0.01, \rel, 0.22, \sinfreq, 60, \glissf, 0.9, \amp, 1, \tempo, 126/60 ); ~snare = Pbind( \instrument, "snare", \dur, Pseq([Rest(1), 1], inf), \att, 0.01, \rel, 0.22, \amp, 0.75, \tempo, 126/60 ); ~bazz = Pbind( \instrument, "bazz", \dur, Pseq([ Pseq([Pn(Pseq([1/2, Rest(1/4)], 1), 4), Pn(1/2, 2)], 3), Pseq([Pn(Pseq([1/2, Rest(1/4)], 1), 4), Rest(1)], 1)], inf), \midinote, 0.6*Pseq([ Pseq( [Pn(Pseq([67, \rest],1), 4), 67, Prand([63, 64, 65, 66, 68, 69, 70, 71], 1)], 3), Pseq( [Pn(Pseq([67, \rest],1), 4), \rest], 1)], inf), \legato, 0.75, \amp, 0.025, \tempo, 126/60 ); ~whiteUpShort = Pbind( \instrument, "whiteUp", \dur, Pseq([7.8], 1), \amp, 0.6, \tempo, 126/60 ); ~tom = Pbind( \instrument, "tom", \dur, Pseq([ Pn(Pseq([Rest(1/2), 1/2, Rest(1), 1/2, 1/2, Rest(1)], 1), 5), Rest(1/2), 1/2, Rest(1), Pn(1/4, 6), Rest(1/2), Pn(Pseq([Rest(1/2), 1/2, Rest(1), 1/2, 1/2, Rest(1)], 1), 1), Rest(1/2), 1/2, Rest(1), 1/3, 1/3, 1/3, 1/3, 1/3, Rest(1/3) ], inf), \ffreq, Pwhite(1800, 2500, inf), \rel, Pwhite(0.1, 0.6, inf), \amp, 0.25, \tempo, 126/60 ); ~whiteDown = Pbind( \instrument, "whiteDown", \dur, Pseq([8], 1), \amp, 0.6, \tempo, 126/60 ); ~fM = Pbind( \instrument, "FM", \dur, Pseq([ Pseq([3, Rest(1)], 3), Pseq([3/4, Rest(1/4)], 4)], inf), \legato, 0.75, \amp, 0.1, \tempo, 126/60 ); ~fMOut = Pbind( \instrument, "FMFizzle", \dur, Pseq([15], 1), \amp, Pgeom(1, 0.8, 15), \tempo, 126/60 ); ///\\\\\\\\\\\\\ /// SEQUENCE \/\ //\\\\\\\\\\\/// Pspawner({ arg spawn; ~tinkleVar = spawn.par(~tinkle); spawn.wait(16); ~softBuildVar = spawn.par(~softBuild); spawn.wait(28); ~whiteUpVar = spawn.par(~whiteUp); spawn.wait(4); ~kickIntroVar = spawn.par(~kickIntro); spawn.seq(~sawBuild); spawn.suspend(~softBuildVar); spawn.suspend(~tinkleVar); ~kickVar = spawn.par(~kick); ~snareVar = spawn.par(~snare); ~windDownVar = spawn.par(~windDown); spawn.wait(16); ~whiteUpShortVar = spawn.par(~whiteUpShort); spawn.wait(16); spawn.par(~tinkleVar); ~bazzVar = spawn.par(~bazz); ~tomVar = spawn.par(~tom); spawn.wait(32); ~whiteUpShortVar = spawn.par(~whiteUpShort); spawn.suspend(~kickVar); spawn.suspend(~tinkleVar); spawn.suspend(~snareVar); spawn.suspend(~windDownVar); spawn.wait(16); ~fMVar = spawn.par(~fM); spawn.wait(16); ~kickVar = spawn.par(~kick); spawn.par(~snareVar); spawn.wait(28); spawn.suspend(~kickVar); spawn.suspend(~bazzVar); spawn.suspend(~snareVar); spawn.suspend(~tomVar); spawn.wait(4); spawn.suspend(~fMVar); }).play; )
code description
Use of Synthdefs, Pbinds, and Pspawner to create a unique track. This track was create for Bruno Ruviaro's course in Experimental Sound Design.
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