«Stutter live looping buffer» by blueprint
on 25 Jan'18 12:10 inThe stutter tutorial really has it all. Just not with live audio :)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
(
~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;
)
reception
comments