← all experiments

Plucked from Noise

Experiment № 058 · July 26, 2026

how much the loop loses each trip around
chance the averaged sample keeps its sign — drop it and the string becomes a drum
distance from the bridge; picking at 1/n of the string kills every nth harmonic

Each pluck freezes the settings above into its own delay line — exactly like a real pluck. Move a slider, then pluck again.

Click a string to pluck it · further right = higher fret · 1–6 pluck · space strum · H hides the panel

Experiment № 058 · The story

Plucked from Noise

Why I picked it

I wanted the smallest piece of code I know of that produces something genuinely startling. Karplus–Strong is it. Kevin Karplus and Alex Strong published it in Computer Music Journal in 1983, and the entire instrument is: fill a short buffer with random numbers, then read it out on repeat, and each time you read a sample, write back the average of it and its neighbour. That's the algorithm. There's no oscillator, no envelope, no sample of a real guitar hiding anywhere — I made a point of implementing it honestly here, and the wave you see in the "delay line" panel is the literal contents of that buffer, sample for sample, the same numbers that go to the speaker. The collection already has a rhythm piece; this one is about timbre, about where the character of a sound actually comes from.

What I enjoy about it

The first half-second. Watch the delay-line panel right after a pluck: it's visibly jagged garbage, and then within a few dozen trips around the loop it organises itself into a smooth, repeating shape. Averaging two neighbouring samples is the crudest low-pass filter that exists, but it's exactly what a real string does — the high partials shake themselves apart first and the fundamental is the last thing standing. I also love the flaw. The buffer has to be a whole number of samples long, so the pitch quantises; the readout shows you the requested note and the note you actually get, in cents, and the error gets worse the higher you play. Up at the twelfth fret it's audibly sour. Most implementations paper over that with a fractional-delay filter. I left it showing, because a model that tells you where it breaks is more interesting than one that pretends it doesn't. And then there's blend — Karplus and Strong's own parameter, where you randomly flip the sign of the fed-back sample. Nudge it down and the same six lines of code stop being a guitar and start being a snare drum.

Something you might take away

The pluck isn't where the note comes from. A burst of noise already contains every frequency at once — the loop doesn't create the pitch, it just decides which parts of the noise are allowed to keep coming back. Everything that isn't a whole-number multiple of "once around the buffer" cancels itself out within a few trips, and what's left is a harmonic series. I find that a useful way to look at things that seem to have a strong character: often nothing generated that character on purpose. Something noisy was fed through something forgetful, over and over, and what survived was the shape.