struct KarplusStrong {
&double buffer;
unsigned long length;
unsigned long pos;
double damping;
}Fields
ring buffer, length 'length' — doubles as the delay line and the pitch period
0..1; closer to 1 = slower decay (typical: 0.99-0.999)
Methods
The next output sample.
Refill the delay line with a new excitation (n samples copied in; if n < length the remainder is left at its previous contents — callers doing a fresh pluck should size the excitation to 'length').
'buffer' is the caller's delay line of 'length' samples; seed it (or call pluck) with an excitation before next().
length = buffer.len