SwitchDelay feedback delay line implementing switch-and-ramp buffer jumping
SwitchDelay.ar(input, drylevel, wetlevel, delaytime, delayfactor, maxdelaytime, mul, add)
A feedback delay line which allows switching the buffer read pointer using the switch-and-ramp technique
as described by Miller S. Puckette in his Theory and Techniques of Electronic Music book.
http://crca.ucsd.edu/~msp/techniques/latest/book.pdf (chapter 4)
Altering the buffer read position, in order to affect the perceived delay speed/timing, creates a
discontinuity in the signal, and usually comes with unwanted audible artefacts. SwitchDelay seeks to
minimize these artefacts by use of the above technique. See the examples below for comparison.
input - a signal to be filtered
drylevel - level of dry signal (default: 1.0)
wetlevel - level of delayed signal (default: 1.0)
delaytime - seconds to delay signal (default: 1.0)
delayfactor - multiplier for feedback level, affects the length of the feedback tail (default 0.7)
limited slightly below 1.0 to avoid speaker damaging mistakes
maxdelaytime - buffer size (default 20.0)
See also: CombN etc
// Load a soundfile:
b = Buffer.read(s, "sounds/a11wlk01.wav");
// simple feedback line, no modulation
(
SynthDef('help-switchdelay-1', { arg out=0, bufnum, delaytime;
Out.ar(out,
DelayLineCM2.ar(
PlayBuf.ar(numChannels: 1, bufnum: bufnum, loop: 0) * 0.5,
delaytime: delaytime,
wetlevel: 0.6
)
);
}).send(s);
)
x = Synth('help-switchdelay-1', [\bufnum, b, \delaytime, 2.0]);
x.free;
// this time, change the buffer read pointer periodically.
(
SynthDef('help-switchdelay-2', { arg out=0, bufnum, delaytime;
Out.ar(out,
DelayLineCM2.ar(
PlayBuf.ar(numChannels: 1, bufnum: bufnum, loop: 0) * 0.5,
wetlevel: 0.6,
delaytime: Select.kr(
Stepper.kr(Impulse.kr(0.5), 0, 0, 3),
[ 0.02, 0.1, 0.725, 0.25 ]
)
)
);
}).send(s);
)
x = Synth('help-switchdelay-2', [\bufnum, b, \loop, 0, \delaytime, 2.0]);
x.free;