Karplus-Strong String Synthesis

A short burst of noise fed through a delay loop with slight low-pass filtering simulates the decaying vibration of a plucked string. Click keys or press keyboard keys 1–9, A–K.

Algorithm: Fill a delay line of length ≈ f_s/f with white noise. Each sample: y[n] = decay × 0.5 × (buf[p] + buf[p−1]). The delay line length sets pitch; low-pass averaging damps high harmonics (like a real string). Invented by Karplus & Strong (1983), extended by Jaffe & Smith (KSSE). Used in countless synthesizers since.