A string you can pluck: it rings at its pitch and fades away like a guitar, harp or harpsichord string, all made by imitating how a real string moves.

In the menu: sources, then physical models.
When you pluck a guitar string, you pull it aside and let go. A ripple runs along the string, bounces off the ends, and runs back, over and over, hundreds of times a second. That back-and-forth is the note you hear: the shorter or tighter the string, the faster the ripple goes round, and the higher the note. Each time round, the string loses a little of its energy, so the note fades; and it loses its sharpest, brightest wiggles fastest, so the note starts bright and becomes mellower as it fades.
The plucked string does just that, in the computer. When it's plucked, it starts a short burst of noise, a random scribble, travelling round a loop exactly as long as one vibration of the string. Each time round it's smoothed a little and made a little quieter. Within a few trips the random scribble settles into a steady shape, and what you hear is a clear, pitched note that rings and fades like a real string. No recording of a real instrument is used: the node works the sound out as the string vibrates.
The view at the bottom of the node shows the shape of the string as it vibrates, with a circle where it was plucked. Here's a string being plucked, its view settling and fading, and the scope beside it showing its sound:
The pictures below show what happens inside: at first the noise of the pluck simply comes round again each vibration, but half a second later it has become a smooth, repeating wave.

Each of these plays the same note three times, changing one setting:
Damping and decay together decide the material: little damping and a long decay sound like a steel string or a harp, more damping like nylon, and a short decay with a lot of damping like a muted string or a pizzicato. Turning the damping up beyond a certain point (around 0.5 to 0.9, depending on the note and the decay) makes no further difference; there the string is already as dull as the node allows.
Connect a note to frequency converter to the frequency input, a trigger to pluck, and a velocity to amplitude, and the string plays tunes. This simple guitar does just that, with one refinement: when a key is let go, an adsr turns the decay right down, so the string stops ringing, the way a guitarist's hand damps the strings.

Anything connected to the excitation input is fed into the string continuously. A string picks out and rings at its own pitch from whatever it's given, so a quiet, steady noise keeps it singing, a little like a bowed string or a bottle being blown across. Here, the noise swells and fades with a slow LFO:

Keep the amplitude low when feeding a steady sound into the excitation input: a string tuned to a note in that sound, with a long decay, can build up and get very loud.
The plucked string is a physical model, the Karplus–Strong algorithm with the refinements David Jaffe and Julius Smith gave it in 1983: an allpass filter that tunes the loop to a fraction of a sample, a loss filter that sets the decay of the fundamental and the highs separately, a pick-position comb filter, and a low pass on the pluck that sets its dynamic brightness. The result is a harmonic, string-like tone, in tune across its range (within a cent, in tests from 55 Hz to 4 kHz).
The loop loses energy at every frequency, but the highs faster, which is the defining property of real strings: the attack has every harmonic, and the tone grows darker as the note rings, until only the fundamental is left. Decay is the T60 of the fundamental, the time for it to fall 60 dB. Damping sets how much shorter the T60 of the top harmonics is: at 0, every harmonic rings as long as the fundamental, giving an unnaturally bright, sitar-like or metal-string shimmer; towards 1, the upper harmonics die within tens of milliseconds, leaving a dark, rounded, gut- or nylon-like note.

The loss filter's high-frequency loss is limited so that it never takes more than half of the fundamental's loss (see the math section), so damping reaches the dullest the string allows well before 1, the sooner for short decays and very low or high notes. For a still darker sound, follow the string with a low pass filter.
Real strings fade faster in the treble register, so for realistic instruments shorten the decay as the note rises: a note to factor converter into a factor to time converter on the decay, as Sonido's guitar synths do. For a palm mute, cut the decay to 100 to 300 ms and raise the damping.
Plucking at a point a fraction p of the way along a string leaves out every harmonic with a node there: every harmonic that's a multiple of 1/p. At p = 0.5, the string's midpoint (over the twelfth fret of an open string), the even harmonics vanish, giving a hollow, clarinet-like tone; at 0.2, the 5th, 10th and 15th are gone; near the bridge (0.05 to 0.1), the low harmonics are weak and the high ones strong, giving the thin, nasal twang of ponticello playing or a pick close to the bridge.

Brightness is the pluck's spectrum: a low pass on the noise burst, with its cutoff one octave above the note at 0 (twice its frequency), rising to eight octaves above at 1 (256 times), where it no longer filters anything audible. It's the difference between flesh and plectrum, and it's the natural thing to connect velocity to, along with amplitude, so harder notes are brighter as well as louder, as on any real instrument.
The excitation input turns the string into a tuned resonator. A loop of length P samples and gain g is a comb filter: it resonates at the string's fundamental and every harmonic, and decays at the string's own rates. Driven with noise, it gives a breathy, bowed or blown tone at its pitch; driven with drums or a voice, it adds a pitched, metallic ring that sounds like sympathetic strings, or the "resonator" effects common in electronic production. Several strings tuned to a chord, fed the same input, make it ring in that chord.
The plucked string is a digital waveguide: a recirculating delay line whose total delay is exactly one period of the note, with the string's frequency-dependent losses lumped into one filter in the loop.

With the loop's three parts, a delay of L whole samples, an allpass H_ap for the fraction of a sample left over, and a one-pole low pass H_lp with a gain g, the string's response to its excitation (scaled by the amplitude a) is

with

Its poles lie close to the harmonics e^{j k ω}, k = 1, 2, …, at radii that set each harmonic's decay. The output is the loop's sum, scaled by 0.4, so a pluck at amplitude 1 peaks near full scale.
The loop's phase delay at the fundamental ω = 2π f / f_s must be exactly one period. The low pass delays by τ_lp(ω) = atan2(b sin ω, 1 − b cos ω)/ω samples; L whole samples are taken from what's left, leaving a fraction Δ between ½ and 1½ samples, where a first-order allpass's phase delay is most nearly constant; and the allpass's coefficient is chosen to give exactly Δ at ω:

That's what keeps it in tune at high notes, where the period is only a few samples. The original Karplus–Strong loop, a whole-sample delay and a two-point average (half a sample's delay), can only make periods of N + ½ samples: at 44.1 kHz, it's 16 cents flat at 1 kHz, 35 at 2 kHz and 73 at 4 kHz. This node measures within a cent of the target throughout. (The harmonics are very slightly inharmonic, since H_lp's delay varies with frequency; for the damped upper harmonics this is inaudible.)
A wave going round the loop at the fundamental is scaled by g|H_lp(e^{jω})| per period, f times a second, so for it to fall 60 dB (a factor of 10³) in T60 seconds:

The damping d sets a second time, T_hi = T60 / 1000^d, for the highest frequencies, and the low pass's coefficient b gives the corresponding extra loss at Nyquist, where |H_lp(−1)| = (1 − b)/(1 + b), relative to its gain of 1 at DC:

Then g makes up what the low pass takes from the fundamental, capped at 0.99999 so the loop can't ring forever or grow. One more constraint caps b: the low pass may take at most half of the fundamental's loss in decibels, |H_lp(e^{jω})|² ≥ 10^(−3/(f T60)), solved as a quadratic in b. Without it, at short decays and high damping, the low pass would take nearly everything and g would sit at its cap, leaving any component below the fundamental (above all, the pluck's DC offset, which the low pass passes untouched) decaying only by g per period: for minutes. With it, DC decays by g ≤ 10^(−3/(2 f T60)) per period, within twice the decay time. This is why damping saturates, at a value that depends on f and T60 (for instance 0.72 at 110 Hz with a 3 s decay, 0.56 at 220 Hz with 0.5 s).
A pluck starts a burst of uniform white noise one period long (round(f_s/f) samples), during which the loop's feedback is muted, so the burst replaces whatever was ringing rather than adding to it. The burst, plus the excitation input, goes through two filters before entering the loop:
The comb's magnitude at the k-th harmonic is the familiar pick-position weighting:

which is zero for every harmonic k that's a multiple of 1/p.
Per sample: one read and two writes of circular buffers (the loop and the pluck's history, each long enough for 20 Hz), an allpass, two one-pole filters and a comb: about a dozen multiplies. L, Δ, c, b and g are recomputed only when the frequency, decay, damping or brightness changes. All of the state is kept in double precision.
Back to Sources: physical models