Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Final 115
name
code content
//samples a= Buffer.read(s,"/Users/alg31/Desktop/project sounds/SwagX3.wav" ); t= Buffer.read(s, "/Users/alg31/Desktop/project sounds/Taylor Gang1.wav"); t.play; a.play; //SynthDefs ( SynthDef("plucking", {arg amp = 0.1, freq = 440, decay = 5, dampen = 0.1; var env, snd; env = Env.linen(0, decay, 0).kr(doneAction: 2); snd = Pluck.ar( in: WhiteNoise.ar(amp), trig: Impulse.kr(0), delaytime: freq.reciprocal, decaytime: decay, coef: dampen); Out.ar(0, [snd, snd]); }).add; 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: 2, 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; 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("am3", {arg freq = 440, modfreq = 2, amp = 0.2, att = 0.01, sus = 0.2, rel = 3, gate = 1, pos = 0; var carrier, modulator, env; env = Env.asr( attackTime: att, sustainLevel: sus, releaseTime: rel ).kr(doneAction: 2, gate: gate, mul: amp); modulator = SinOsc.ar(modfreq).range(0, 1); freq = freq * LFNoise2.kr([2, 1/2, 1/3, 1/4, 1]).range(0.98, 1.02); carrier = Pulse.ar(freq: freq, mul: env * modulator); carrier = Mix.ar(carrier); carrier = LPF.ar(carrier, Line.kr(10000, 1000, att)); Out.ar(0, Pan2.ar(carrier, pos)); }).add; SynthDef("fm2", {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 = SinOsc.ar(freq: modfreq, mul: freqdev); carrier = SinOsc.ar(freq: freq + modulator); env = Env.asr( attackTime: att, sustainLevel: amp, releaseTime: rel ).kr(doneAction: 2, gate: gate); carrier = Pan2.ar(in: carrier, pos: pos, level: env); Out.ar(0, carrier * 0.5); }).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("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; ) ) //Pbinds ( ~intropluck = Pbind( \instrument, "plucking", \degree, Pseq([15, 8, 8, 15, 8, 8, 16, 12, 16, 12, 12, 16, 12, 12, 15, \rest], inf), \mtranspose, 0, \amp, Pwhite(0.2, 0.3), \decay, 3, \dampen, 0.15, \dur, Pseq([Pn(0.5, 15), Rest(0.5)], inf), ); ~swag = Pbind( \instrument, "granny1", \rate, Pseq([0.9], 1), \amp, 1, \startPos, 0.4, \attack, 1, \release, 0.25, \buffer, a, \dur, 1, ); ~swagfast = Pbind( \instrument, "granny1", \rate, 1.6, \amp, 1, \startPos, 0.4, \attack, 0.2, \release, 1, \buffer, a, \dur, Pseq([1/2], 1), ); ~buffer = Pbind( \instrument, "granny1", \rate, -0.4, \amp, Pseq([0.3, 0.3, 0.3, 0.3], 1), \startPos, 0.5, \attack, 0.9, \release, 0.3, \buffer, t, \dur, Pseq([2], 1), ); ~hihat1 = Pbind( \instrument, "hihat", \dur, Pseq([1/8, Rest(1/8)], inf), \att, 0.05, \rel, 0.1, \ffreq, Pseq([9000, \rest, 9000, \rest, 9000, \rest, 9000, \rest, 1000, \rest, 9000, \rest, 9000, \rest, 9000, \rest], inf), \pan, 0, \amp, 0.2, ); ~hihat2 = Pbind( \instrument, "hihat", \dur, Pseq([1/2, Rest(1/2), Pn(1/4,2), Rest(1/2), Pn(1/4, 4), Rest(1)], inf), \att, 0.05, \rel, 0.1, \ffreq, 1000, \pan, 0, \amp, 0.2, ); ~hihat3 = Pbind( \instrument, "hihat", \dur, Pseq([1/2, Rest(1/2), 1/2, Rest(1/2)], inf), \att, 0.05, \rel, 0.1, \ffreq, 5000, \pan, 0, \amp, 0.2, ); ~bass1 = Pbind( \instrument, "fm2", \dur, 1, \note, Pseq([[0, 0.5, 1], 1, [0, 0.2, 0.4], -2], inf), \ctranspose, -18, \modindex, 1, \amp, Pseq([0.3, 0.35, 0.4, 0.45, 0.5, 0.45, 0.4, 0.3, 0.2], inf), \att, 0.01, \rel, 0.2, \pos, 0 ); ~bass3 = Pbind( \instrument, "kick", \dur, Pseq([1, 1, 1, 1, 1/4, 1/4, 1/4, 1/4, 1/4], inf), \att, 0.01, \rel, 0.22, \sinfreq, Pseq([50, 50, 50 , 50, 70, 70, 70, 70, 50],64), \glissf, 0.9, \amp, 1, ); ~bass11 = Pbind( \instrument, "fm2", \dur, Pseq([1, 1/4, 1/4, 1/4, 1/4, 1, 1/2, 1/2], inf), \note, Pseq([[0, 0.5, 1], 1, 1, 1, 1, [0, 0.2, 0.4], -2, -2], inf), \ctranspose, -18, \modindex, 1, \amp, Pseq([0.3, 0.35, 0.4, 0.45, 0.5, 0.45, 0.4, 0.3, 0.2], inf), \att, 0.01, \rel, 0.2, \pos, 0 ); ~snare = Pbind( \instrument, "snare", \dur, Pseq([1/4, Rest(1/4)], 4), \att, 0.01, \rel, 0.1, \sinfreq, 180, \ffreq, 2000, \amp, 0.25 ); ~bass1slow = Pbind( //dur*1.5 \instrument, "fm2", \dur, 1.5, \note, Pseq([[0, 0.5, 1], 1, [0, 0.2, 0.4], -2], 2), \ctranspose, -18, \modindex, 1, \amp, Pseq([0.3, 0.35, 0.4, 0.45, 0.5, 0.45, 0.4, 0.3, 0.2], inf), \att, 0.01, \rel, 0.2, \pos, 0 ); ~outropluck = Pbind( //dur*1.5 \instrument, "plucking", \degree, Pseq([15, 8, 8, 15, 8, 8, 16, 12, 16, 12, 12, 16, 12, 12, 15, 15, 15, \rest], 1), \mtranspose, 0, \amp, Pwhite(0.2, 0.3), \decay, 3, \dampen, 0.15, \dur, Pseq([Pn(0.75, 15), Rest(0.75)], inf), ); ) ) //Pspawner ( Pspawner({ arg maestro; ~player1=maestro.par(~intropluck); //intro pluck 8.wait; ~player6=maestro.par(~swagfast); //swag 8.wait; //intro pluck ~player6=maestro.par(~swagfast); //swag maestro.suspend(~player1); 1.wait; ~player9=maestro.par(~buffer); //tgang buffer 0.5.wait; ~player6=maestro.par(~swagfast); //swag 0.5.wait; ~player3=maestro.par(~hihat1); //hihat & DIRTYBASS start together ~player4=maestro.par(~bass1); 4.wait; ~player9=maestro.par(~swag); //slow swag 8.wait; //continue hihat & bass for 8.. ~player1=maestro.par(~intropluck); //resume pluck!! 16.wait; maestro.suspend(~player1); //suspend pluck maestro.suspend(~player3); //suspend OG hihat maestro.suspend(~player4); //suspend DIRTYBASS 1.wait; ~player11=maestro.par(~snare); //add a little count up! 1.wait; ~player4=maestro.par(~bass1); //resume DIRTYBASS ~player5=maestro.par(~hihat2); //start new hihat 16.wait; ~player7=maestro.par(~bass3); //add new bass to DIRTYBASS maestro.suspend(~player5); //end new hihat, start LESS hihat ~player8=maestro.par(~hihat3); 16.wait; maestro.suspend(~player7); //stop new bass 4.wait; maestro.suspend(~player8); //end LESS hihat ~player1=maestro.par(~intropluck); //intropluck comes back. 16.wait; maestro.suspend(~player4); //end dirtybass1 ~player10=maestro.par(~bass11); //start dirtybass2 ~player3=maestro.par(~hihat1); //resume OG hihat 16.wait; maestro.suspend(~player3); //suspend OG hihat maestro.suspend(~player10); maestro.suspend(~player1); 1.wait; ~player9=maestro.par(~buffer); //tgang buffer 1.wait; ~player12=maestro.par(~bass1slow); //end on SLOWER dirtybass & slower pluck ~player13=maestro.par(~outropluck); 13.wait; maestro.suspendAll; }).play; )
code description
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