// title: fun little instrument // author: whillas // description: // Simple Pulse with some delayed feedback and a 2D Slider as an interface. Sliding around gives different effects to just clicking in different spots. // code: ( // Levels scaling //m = m ? 0.8;// live m = m ? 1.2;// rehersal Ndef(\pul, { | freq=80, rq=0.001, amp = 0.91 | RLPF.ar( Pulse.ar([100,250],0.5,0.1), freq: freq, rq: rq, mul: amp ) + (DelayC.ar(Ndef(\pul).ar) * 0.9) }).play; // GUI: 2D slider w = Window("Pulse", Rect(100,Window.screenBounds.height - 400, 300, 300)); w.view.decorator = FlowLayout(w.view.bounds); t = Slider2D(w, Rect(0, 0,292, 292)) .y_(1.0) .x_(0.0) .background_(Color.rand) .knobColor_(Color.rand) .action_({|pos| Ndef(\pul).set( \freq, pos.x.linexp(0,1.0, 80, 8000), \rq, pos.y.linlin(0, 1.0, 0.001, 1.0) ) }); w.front; CmdPeriod.doOnce({w.close; Ndef(\pul).clear(4)}); ) // Kill it w.close; Ndef(\pul).clear(4);