// title: Lag to make waves // author: 38nonprivate // description: // A starting point for "analogue emulation." Lagging a Pulse in different ways depending on direction of the input (up or down) changes the waveform as MouseX is swept from left to right. // code: ( { var freq = 100, shape, up, down, output; shape = MouseX.kr(0, 1); up = shape.clip(0.5, 1.0); up = [0.5, 1.0].asSpec.unmap(up); up = [0.0, 0.5].asSpec.map(up); down = shape.clip(0.0, 0.5); //up.poll; down.poll; output = Lag2UD.ar(Pulse.ar(freq, 0.5), freq.reciprocal * up, freq.reciprocal * down); output ! 2 }.scope; )