// title: Stutter live looping buffer // author: blueprint // description: // The stutter tutorial really has it all. Just not with live audio :) // code: ( ~stutter = { |snd, reset, fragmentlength, rate = 1.0, maxdelay = 10| var phase, fragment, del; phase = Sweep.ar(reset); fragment = { |ph| (ph - Delay1.ar(ph)) < 0 + Impulse.ar(0) }.value(phase / fragmentlength % 1); del = Latch.ar(phase, fragment) + ((fragmentlength - Sweep.ar(fragment)) * (rate - 1)); DelayC.ar(snd, maxdelay, del); }; ) // This is just an example of doing it live which was missing in the stutter tutorial :) ( { var snd, reset; snd = AudioIn.ar([1,2]); reset = Onsets.kr(FFT(LocalBuf(512), snd), 0.7); snd = ~stutter.(snd, reset, 0.09); snd = DelayC.ar(snd, 0.2, 0.2); snd!2 * 0.3; }.play; ) // Of course you can also: // sequencing with Pmono ( SynthDef(\stuttertest, { |out = 0, buf, t_reset = 0, fragmentlength = 0.1, amp = 0.1| var snd, reset; snd = AudioIn.ar([1,2]); reset = Onsets.kr(FFT(LocalBuf(512), snd), t_reset); snd = ~stutter.(snd, reset, fragmentlength); Out.ar(out, snd * amp!2); }).add; ) ( Pmono(\stuttertest, \buf, b, \amp, 0.3, \reset, 0.7, \dur, 0.1, \fragmentlength, Pseq([0.01, 0.03, 0.07, 0.05, 0.06], inf) ).play; )