Skip to content

Instantly share code, notes, and snippets.

@joefutrelle
Last active November 10, 2017 16:44
Show Gist options
  • Save joefutrelle/9104146 to your computer and use it in GitHub Desktop.
Save joefutrelle/9104146 to your computer and use it in GitHub Desktop.
Supercollider patch named for Ben Grosser (2004)
(
Routine({
SynthDef("buzz", {arg bufnum;
var dust, pitch, density, amp, env, pan, osc, gate;
var brown1, brown2, brown3, brown4, brown5;
var pitch1, pitch2;
pitch1 = IRand(10,128);
pitch2 = IRand(10,128);
brown1 = LFNoise2.kr(LFNoise2.kr(0.1, 10).abs + 0.1, LFNoise2.kr(0.1, 1.0).abs).abs;
brown2 = LFNoise2.kr(LFNoise2.kr(0.1, 10).abs + 0.1, LFNoise2.kr(0.1, 1.0).abs).abs;
brown3 = LFNoise2.kr(LFNoise2.kr(0.1, 10).abs + 0.1, LFNoise2.kr(0.1, 1.0).abs).abs;
brown4 = LFNoise2.kr(LFNoise2.kr(0.1, 10).abs + 0.1, LFNoise2.kr(0.1, 1.0).abs).abs;
brown5 = LFNoise2.kr(LFNoise2.kr(0.1, 10).abs + 0.1, LFNoise2.kr(0.1, 1.0).abs).abs;
gate = LFPulse.kr(Rand(0.1,0.11),0,Rand(0.25,0.75));
density = brown2 ** 2 * 24 + 0.25;
dust = Dust.kr(density, 0.2) * gate;
pitch = TIRand.kr(min(pitch1, pitch2), max(pitch1, pitch2), dust).midicps;
pan = Rand(0,1);
amp = TRand.kr(0, brown3, dust) ** 0.5 * 0.2;
env = Linen.kr(Trig.kr(dust, 0.001), 0, 1, TRand.kr(0, 1/density, dust) + 0.1) ** 0.15 * amp;
osc = Osc.ar(bufnum, pitch, 0, env);
Out.ar(0, [osc * pan, osc * (1 - pan)]);
}).send(s);
5.do({arg i;
var buf;
buf = Buffer.new(s, 512);
buf.alloc;
0.2.wait;
buf.setn(0, Array.fill(512, { rrand(0,1) }));
0.2.wait;
s.sendMsg(\s_new, \buzz, 2000+i, 1, 0, \bufnum, buf.bufnum);
})
}).play
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment