Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / examples / demonstrations / snare909.scd
blob0869c75706d70c65935596431db3b21dc58533b6
3 SynthDef(\snare909,{ |out=0,mul=1,velocity=1|
4         var excitation, membrane;
6         excitation = LPF.ar(WhiteNoise.ar(1), 7040, 1) * (0.1 + velocity);
7         membrane = (
8                 /* Two simple enveloped oscillators represent the loudest resonances of the drum membranes */ 
9                 (LFTri.ar(330,0,1) * EnvGen.ar(Env.perc(0.0005,0.055),doneAction:0) * 0.25)
10                 +(LFTri.ar(185,0,1) * EnvGen.ar(Env.perc(0.0005,0.075),doneAction:0) * 0.25)
12                 /* Filtered white noise represents the snare */
13                 +(excitation * EnvGen.ar(Env.perc(0.0005,0.4),doneAction:2) * 0.2)
14                 +(HPF.ar(excitation, 523, 1) * EnvGen.ar(Env.perc(0.0005,0.283),doneAction:0) * 0.2)
16         ) * mul;
17         Out.ar(out, membrane!2) 
18 }).add
21 Synth(\snare909,[\mul,0.5,\velocity, rrand(0.5, 1.0)]);