// Making a gated reverb ( s.options.memSize_(2.pow(16)); t = TempoClock(66/60).permanent_(true); ~makeev = { ~ev = Dictionary.new; //~ev.add(\cr1 -> ~crackle = {Crackle.ar(1.99, 0.05)!2}.play;); //~ev.add(\cr2 -> ~crackle.release); ~ev.add(\bassdrum -> ~drum = Pbind( \instrument, \bd, \dur, Pseq([Pn(1, 3), 1.125], inf), \amp, 1, ); ) }; /* ~p1 = ~drum.play(t); ~p1.stop;*/ ~cleanup = { "see you!".postln; Window.closeAll; s.newBusAllocators; ServerBoot.removeAll; ServerTree.removeAll; ServerQuit.removeAll; }; //////////// register functions ServerBoot.add(~makeev); ServerQuit.add(~cleanup); s.waitForBoot({ s.plotTree; s.meter.window.alwaysOnTop_(true); SynthDef(\bd, { var sig, env; env = Env.perc(0.0001, 1.2).kr(2); sig = AnalogBassDrum.ar( Impulse.kr(0), 0, 0.7, 50, 0.33, 0.75, 0.4, 0.33 ); sig = Pan2.ar(sig * \amp.kr(0.95) * env, 0); Out.ar(0, sig); }).add; }); ) // first part: figure out MIDIClient.init; MIDIIn.connectAll; MIDIFunc.trace(true); ~ev // this doesn't quite work ~ev[\bassdrum].play; ~ev[\bassdrum].stop; ~drum.stop; // make a synthdef ( SynthDef(\noisySaw, { arg dry = 1; var sig, freq, env; env = Env.perc(\atk.ir(0.12), \rel.ir(4)).kr(2); freq = \freq.kr(220, 0.5); sig = VarSaw.ar( freq, 0, 0.45, 0.2 ); sig = sig + BrownNoise.ar(0.01); sig = sig.softclip; sig = HPF.ar(sig, 50); sig = LPF.ar(sig, 2400); sig = sig * env * \amp.kr(0.45); sig = Pan2.ar(sig); Out.ar(0, sig); }).add; ) Synth(\noisySaw); ( //~more = Dictionary.new; ~more.add( \p1 -> ~noi = Pbind( \instrument, \noisySaw, \scale, Scale.minorPentatonic(\werckmeister), \octave, Pwrand([3, 4, 5, 6], [1, 4, 3, 2].normalizeSum, inf), \degree, Pxrand((0..6), inf), \amp, Pwhite(0.3, 0.5), \dur, Pwhite(0.66, 2) ).play; ); ~more.add( \p2 -> ~noi.stop; ); ) ~more.removeAt(\p2); ~more[\p1].play; ~more[\p1].stop; ~more[\p2].value // kthxbye! ( s.quit; )