Module dsp::comb
Comb filters + Karplus-Strong string synthesis
CombFF (feedforward comb): y[n] = x[n] + gainx[n-delay] — an FIR delay- and-add; produces evenly-spaced notches in the frequency response. CombFB (feedback comb): y[n] = x[n] + gainy[n-delay] — an IIR delay- and-add; produces evenly-spaced resonant peaks instead (the basis of most artificial reverb algorithms — a bank of feedback combs at different delays/gains, often followed by allpass filters).
KarplusStrong is the classic plucked-string/percussion synthesis algorithm (Karplus & Strong, 1983): a feedback comb whose feedback path is itself a 2-tap averaging lowpass (delayLine[n] and delayLine[n-1] averaged, then scaled by 'damping') instead of a plain scalar gain — the averaging progressively removes high-frequency energy each time around the loop, which is what makes a plucked string's timbre brighten- then-decay the way it audibly does. Seed the delay line with an excitation buffer (e.g. white noise, or a single impulse) via KarplusStrong::new/pluck, then call next() repeatedly — the string is self-sustaining except for the built-in decay.
The comb filters are SampleFilters and the Karplus-Strong strings are SampleGenerators (see sample_filter.h): a string takes no input, so its methods are next() and pluck(), not process() and reset().
Structs
| CombFF | |
| CombFB | |
| KarplusStrong | |
| CombFF32 | Single precision: the three filters above on float buffers. |
| CombFB32 | |
| KarplusStrong32 | |
| FCombFF | |
| FCombFB | |
| FKarplusStrong |