Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: A4 Granular Modulations
name
code content
// ================================= // A4 - musc-115-granular // GRANULAR SAMPLING // ================================= Krystof Komers A4 // load a sound file (or two...) b = Buffer.read(s, "/Users/krystof/Downloads/A3/when the levee breaks short.wav"); // buffer handy tools: b.play; b.numChannels; b.duration; b.numFrames; c = Buffer.read(s, "/Users/krystof/Downloads/A3/Electric Funeral short.wav"); c.play; c.numChannels; c.duration; c.numFrames; w = Buffer.read(s, "/Users/krystof/Downloads/A3/walkshort.wav"); w.play; w.duration; ////////////////////////////////////// ( SynthDef("bill1", {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; SynthDef("bill2", {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; SynthDef("bill3", {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("bill5", {arg rate = 1, amp = 1, buffer, startPos = 0, attack = 0, release = 10, panning = 0; var snd, env; env = Env.perc(releaseTime: release, level: amp).kr(doneAction: 2); snd = PlayBuf.ar( numChannels: 1, bufnum: buffer, rate: rate, ); snd = snd * env; snd = Pan2.ar(snd, panning); Out.ar(0, snd); }).add; ) //1ST PBind Bill 1 ( ~one = Pbind( \instrument, "bill1", \rate, Pseq([1,2,3,1], 6), \amp, 1, \startPos, 0.24, \attack, 0.01, \release, 0.3, \buffer, b, \dur, 0.25, ); ~one.play; ) // 1.5 Buffer C ( ~onefive = Pbind( \instrument, "bill1", \rate, Pseq([3, 2, 1, 3], 4), \amp, 1, \startPos, 0.24, \attack, 0.01, \release, 0.3, \buffer, c, \dur, 0.25, ); ~onefive.play; ) //2ND Pbind Bill 1 different filter ( ~two = Pbind( \instrument, "bill1", \rate, Pseq([2, 5, 8, 9, 9.5, 7.5, 6, 4], 8), \amp, 1, \startPos, Pseq([0.24, 0.33, 0.66, 0.89], 8), \attack, 0.01, \release, 0.1, \buffer, b, // which buffer to play from \dur, 0.20, ); ~two.play; ) //2.5 Buffer C different filter ( ~twofive = Pbind( \instrument, "bill1", \rate, Pseq([2, 5, 8, 9, 9.5, 7.5, 6, 4], 8), \amp, 2, \startPos, Pseq([0.24, 0.33, 0.66, 0.89], 8), \attack, 0.01, \release, 0.1, \buffer, c, // which buffer to play from \dur, 0.5, ); ~twofive.play; ) // 3RD Pbind Bill 2 Harmonic filter ( ~three = Pbind( \instrument, "bill2", \rate, Pseq([4, 3, 2, 0.92, 1.01, 1, 1, 9], inf), \amp, 6, \startPos, Pseq([0.24, 0.33, 0.66, 0.89], inf), \attack, 0.04, \release, 0.4, \ffreq, Pseq([ 1000, 1250, 1500, 2000], inf), \rq, 0.01, \buffer, b, \dur, 0.1, \panning, Pwhite(-0.5, 0.5) ); ~three.play; ) // 3.5 Buffer C Bill 2 harmonic filter ( ~threefive = Pbind( \instrument, "bill2", \rate, Pseq([4, 3, 2, 0.92, 1.01, 1, 1, 9], 15), \amp, 8, \attack, 0.04, \release, 0.4, \ffreq, Prand([1000, 2000], inf), \rq, 0.01, \buffer, c, \dur, 0.1, \panning, Pwhite(-0.5, 0.5) ); ~threefive.play; ) ( ~four = Pbind( \instrument, "bill5", \amp, 4, \buffer, w, \rate, Pseq([1,0],1), \release, 40, ); ~four.play; ) // 4TH Pbind Bill 3 and other stuff who knows) SAVED P BIND FOR LATER // ================================= // Putting stuff together with Pspawner // ================================= s.record; ( Pspawner({ arg maestro; maestro.seq(~four); maestro.seq(Ppar([ ~two])); maestro.seq(Ppar([ ~one, ~two])); maestro.seq(Ppar([~four, ~two, ~twofive, ~threefive])); maestro.seq(Ppar([~twofive, ~two, ~threefive, ~one])); maestro.seq(~four); maestro.seq(Ppar([~onefive, ~twofive])); }).play; ) // old line to test the synth Synth("walkbass", [\rate, 3, \amp, 0.5, \buffer, w]);
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