Or clap or whatever. I don't actually like snare drums or their ilk very much.
Here's the part where I can push faders around to get good values:
( SynthDef(\snare, {|out = 0, freq, rq, hpf_d, hpf_cv, curve, dur, amp, pan = 0| var noise, hpf, hpf_env, env, panner, imp; noise = PinkNoise.ar(1); imp = Impulse.ar(1/(dur + 0.1), 0, amp); env = EnvGen.kr(Env.perc(0.0005, dur, amp), doneAction:2); hpf_env = EnvGen.kr(Env.perc(0.001, hpf_d, hpf_cv, curve)) - 12; hpf = RHPF.ar(noise, (freq.cpsmidi + hpf_env).midicps, rq) * env; panner = Pan2.ar(hpf + imp, pan); Out.ar(out, panner); }).store; Conductor.make({|cond, freq, rq, hpf_d, hpf_cv, curve, dur, db| freq.spec_(\freq, 200+660.rand); rq.spec_(\rq, 0.45 + 0.1.rand); hpf_d.sp(1, 0.0001, 1.45, 0, 'linear'); hpf_cv.sp(24, 0, 36, 0, 'linear'); dur.sp(1, 0.0001, 1.5, 0, 'linear'); db.spec_(\db, 0.2.ampdb); curve.sp(-3, -1, -8, 1, 'linear'); cond.pattern_( Pbind( \instrument, \snare, \db, db, \freq, freq, \rq, rq, \hpf_d, hpf_d, \hpf_cv, hpf_cv, \dur, dur, \curve, curve ) ); }).show; )
That requires the Conductor Quark. I'm not sure about that sound design, anyway. And here's the final version:
SynthDef(\snare, {|out = 0, hit_dur, amp = 0, pan =0| var noise, hpf, hpf_env, env, panner, imp; noise = PinkNoise.ar(1); imp = Impulse.ar(1/(hit_dur + 0.1), 0, amp); env = EnvGen.kr(Env.perc(0.0005, hit_dur, amp), doneAction:2); hpf_env = EnvGen.kr(Env.perc(0.001, 0.92, 16.8, -5)) - 12; hpf = RHPF.ar(noise, (78.34 + hpf_env).midicps, 0.57) * env; panner = Pan2.ar(hpf + imp, pan); Out.ar(out, panner); }).store;
Make of it what you will. That single impulse at the beginning gives it a good start, but it doesn't have that paff or bappff - that roundness of attack - of a real snare or even a good analog drum machine. I used to have such a machine, which I didn't actually make ver much use of. Now it lies abandoned in California, alas and woe.
No comments:
Post a Comment