Docs

Strings

Lengths, unisons, losses, polarisations and nonlinearity — how the strings ring, beat and die away.

Each string is a set of modes — its partials — each a damped oscillator computed in complex form. The strings of one key are coupled through the bridge they share, and each vibrates in two directions: counting them all, a note runs a few dozen oscillators in the top treble and several hundred in the bass (768 at most). Nothing here is a filter on a recorded tone: what you hear is that system ringing.

One string · middle C

pinhitchagraffebridgehammer · 0.12 Ldamper (raised) · 0.14 Lspeaking length L = 0.6091 m
The speaking length runs from the agraffe to the bridge (0.6091 m at C4, scale.*). The hammer strikes at 0.12 of it (strike_ratio), the damper rests at 0.14 (damper.position). The string's motion is drawn to scale along it, magnified across — about a millimetre in reality.

Scale

The scale is the set of string lengths. From the top down, each octave is longer by ratio_per_octave (an ideal string would double; real ones do not, or a grand would be ten metres long). Below break_note the case runs out of room: the bass strings are shortened toward len_a0 and made heavier by winding copper around them. With the tension and the pitch, the length gives each string its mass, μ = T / (2·L·f0)².

String length

0.010.1110A0C2C3C4C5C6C7C8m
Speaking length per key (log scale). The generic 2 m grand scale of the default instrument is a placeholder, not a measured one; the knee is the break note.

Unisons

Most keys have two or three strings, struck together. They are never exactly in tune with each other, and should not be: that slight spread is what gives a piano tone its life.

Strings per key, default instrument

12 strings3 strings per keywound stringsphantom partials computedA0B0C1D1E1F1G1A1B1C2D2E2F2G2A2B2C3D3E3F3G3A3B3C4D4E4F4G4A4B4C5D5E5F5G5A5B5C6D6E6F6G6A6B6C7D7E7F7G7A7B7C8A♯0C♯1D♯1F♯1G♯1A♯1C♯2D♯2F♯2G♯2A♯2C♯3D♯3F♯3G♯3A♯3C♯4D♯4F♯4G♯4A♯4C♯5D♯5F♯5G♯5A♯5C♯6D♯6F♯6G♯6A♯6C♯7D♯7F♯7G♯7A♯7A0C1C2C3C4C5C6C7C8

Unison · two strings, slightly apart

one beat: 6.615 s (carrier slowed down)
At middle C the default spread is 1 cent between the extreme strings: 261.6 Hz against 261.8 Hz, a beat every 6.615 s — too slow to hear as a wobble, but enough to make the strings trade energy, which feeds the long, shimmering aftersound. At 12 to 18 cents (the honky-tonk preset) the beats become a sound of their own.

Unison spread

12345A0C2C3C4C5C6C7C8cents
Spread between the extreme strings of a key, in cents: flat to middle C (width_mid), then growing to width_treble at C8. Each key gets an irregular but fixed pattern within it.

hit_spread is the other half of the story: the hammer never strikes the strings of a key evenly, and the uneven part sets them swinging against each other from the start. A soft blow meets them with the surface of the felt only, so the softer the blow, the more uneven it is:

spread(v) = hit_spread · (soft_speed / v)soft_exponent, at most 1

with v the hammer speed: hit_spread at soft_speed (2.75 m/s, a forte), up to the cap at pianissimo. Nor do the strings of a key lie at exactly one height: with height_spread (0.1 mm), a slow hammer reaches them one after the other, a fraction of a millisecond apart. Both keep the aftersound and the upper partials of quiet notes and chords alive.

Two polarisations, two decays

Prompt sound and aftersound

string, end-onverticalhorizontallevel of a note0-20-40-600 s5 s10 s15 s20 sdB← prompt soundaftersound
Left: the string seen end-on. The hammer starts it up and down, the direction in which it moves the bridge most — so that motion gives its energy away quickly, while the sideways motion, barely coupled, rings on. Right: the level of a note, schematically: a steep first decay (the prompt sound), then a slow one 10–20 dB lower (the aftersound). The unisons feed the same effect: their strings, slightly out of tune, drift out of step, and the hammer strikes them unevenly from the start, the more so the softer the blow.

The polarization.* parameters set how weakly the bridge holds the sideways motion (h_coupling), how much energy passes between the two directions (cross — clamped so the bridge stays passive), and how much of the sideways motion is heard.

Losses

Strings lose energy on their own too — air drag, internal friction — on top of what the bridge and soundboard take. The intrinsic decay rate of a partial at frequency f is

σ = b1_floor·w(n) + eb1_slope·n + b1_offset + top(n) + b2·f²

with the T60 = 6.9 / σ. The b2 term makes the high partials die sooner, so the sound darkens as it decays; its default, 6e-8, comes from the sustain of eight real grands. Two terms add losses to some strings, and both are 0 by default:

  • b1_floor, for the wound bass strings, fading out over the octave above wound_until. The bass side of the soundboard now takes that energy (see the soundboard).
  • top_slope, for the top strings, from top_from (C6) up. Above D6 the strings have no dampers, and on real grands the top notes keep a slow, quiet aftersound after their fast first decay, while the key is held and after it is released. Raising top_slope shortens both.

Fundamental T60 (string losses alone)

1101001000A0C2C3C4C5C6C7C8s
How long the fundamental would ring on the string's own losses, before the bridge and the soundboard take their share (log scale).

Nonlinearity

Struck hard, a string stretches a little as it swings, and its tension rises and falls twice per cycle. That drives the string’s longitudinal modes with sums and differences of its partials: the “phantom” partials that give a loud bass its growl. The model computes them up to max_note (E4 by default; above, they are too high to matter), with a level that grows as the square of the amplitude — they are there at forte, gone at piano.

In the application

The Strings page of the Unsampled Piano interface
The Strings page of the interface, default instrument. Its sketch is drawn from the current settings; hover a parameter to light up the part it acts on, click its name for the help shown below.

Parameters

Losses

Wound-string loss floor

rebuild
losses.b1_floor
01default 0 1/s

Extra losses of the wound bass strings (copper wire wound around the steel core rubs on itself).

in the model

Added to σ below wound_until, fading over the octave above. 0.2 /s puts the bass envelopes within 1 dB of Salamander.

B1 offset

rebuild
losses.b1_offset
-15.315.3default -5.1range ≈

Overall sustain of the notes: lower values ring longer.

in the model

Offset of the log-linear term of σ.

B1 slope

rebuild
losses.b1_slope
0.00550.55default 0.055logrange ≈

How much faster notes die away towards the treble, from the strings' own losses (air drag, internal friction). The soundboard adds its own.

in the model

Intrinsic decay rate σ = b1_floor·w(n) + e^(b1_slope·n + b1_offset + top(n)) + b2·f² (1/s), the T60 being 6.9/σ. Fitted on the ESPRIT aftersound of Salamander, then lowered on the long sustain (docs/long_sustain.md).

B2

rebuild
losses.b2
6·10⁻⁹6·10⁻⁷default 6·10⁻⁸logrange ≈

How much faster the high overtones die than the fundamental: higher values make the sound darken sooner as it decays.

in the model

Frequency term b2·f² of σ. 6e-8 from eight real grands' sustain (docs/top_treble.md); 1e-7, set against Salamander (docs/sustain.md), cut the treble's upper partials short.

Top from

rebuild
losses.top_from
A0C8default 84 (C6)range ≈

Key from which the top strings lose energy faster.

in the model

MIDI note where top_slope starts.

Top slope

rebuild
losses.top_slope
-11default 0range ≈

Extra losses of the top strings, which have no dampers: higher values shorten what rings on after the keys are released, and the notes' own slow tail.

in the model

σ's log-linear term gains top_slope·(n − top_from) above top_from. 0 by default: real top strings keep a slow aftersound (docs/top_treble.md); 0.05 (×1.8 at C7) was set against a commercial modelled piano's release ring (docs/release_ring.md).

Wound until

rebuild
losses.wound_until
A0C8default 48 (C3)range ≈

Highest key with wound strings.

in the model

MIDI note where the b1_floor term starts fading (gone an octave higher).

Nonlinearity (phantom partials)

Enabled

rebuild
nonlinear.enabled
default on

Struck hard, a string stretches as it swings, which adds 'phantom' overtones: the growl and brightness of a loud bass.

in the model

Geometric nonlinearity (Bank & Sujbert 2005): the transverse partials drive the longitudinal modes with their sum and difference frequencies; the longitudinal force on the bridge reaches the board. Grows as the amplitude squared; one-way.

Coupling

rebuild
nonlinear.coupling
0.033default 0.3logrange ≈

Loudness of the phantom overtones.

in the model

Share of the longitudinal force at the bridge driving the board; ≈ −28 dB below the partials in the bass at ff (tools/phantom_levels.py).

Coupling corner

rebuild
nonlinear.coupling_corner
10010000default 1000logrange ≈

Slow changes of string tension barely move the board; this filters them out.

in the model

First-order high-pass (Hz) on the longitudinal force: it bends the board through its moment about the bridge foot, which grows with the board's wavenumber.

Long loss

rebuild
nonlinear.long_loss
5·10⁻⁴0.05default 0.005logrange ≈

Damping of the stretching vibrations.

in the model

Loss factor of the longitudinal modes.

Max long

rebuild
nonlinear.max_long_hz
80080000default 8000 Hzlogrange ≈

Highest stretching vibration kept (CPU).

in the model

Longitudinal modes kept (Hz).

Max note

rebuild
nonlinear.max_note
A0C8default 64 (E4)range ≈

Highest key computed: above, the phantom overtones are too high to matter.

in the model

MIDI note (E4: its first longitudinal mode is above 4 kHz).

Max partial

rebuild
nonlinear.max_partial_hz
50050000default 5000 Hzlogrange ≈

Highest overtone taking part (CPU).

in the model

Transverse partials kept in the products (Hz).

Young

rebuild
nonlinear.young
2·10¹⁰2·10¹²default 2·10¹¹logrange ≈

Stiffness of the steel of the strings.

in the model

Young's modulus E (Pa); the core diameter follows from B: B = π³·E·d⁴/(64·T·L²), EA = E·π·d²/4.

Polarisations

Enabled

rebuild
polarization.enabled
default on

Strings vibrate up-and-down and sideways. The sideways motion barely moves the bridge, so it rings much longer: part of the piano's long sustain, even on one-string notes.

in the model

Doubles the oscillators of each partial (vertical and horizontal) in the coupled unison system.

Cross

rebuild
polarization.cross
0.01731.73default 0.173logrange ≈

How much energy passes between the two directions of vibration (bridge rocking, oblique string ends): it slowly transfers the loud up-and-down motion into the long sideways one.

in the model

ε_X/ε_V. The bridge stays passive only if ε_X² ≤ ε_V·ε_H, so it is clamped at √h_coupling; the default sits at that limit.

Detune

rebuild
polarization.detune_cents
0.033default 0.3 centslogrange ≈

Pitch difference between the sideways and up-and-down vibrations (the string's ends hold it differently in each direction).

in the model

Horizontal minus vertical frequency (cents).

H coupling

rebuild
polarization.h_coupling
0.0030.3default 0.03logrange ≈

How much the bridge gives sideways, relative to up-and-down. Low: the sideways motion rings long and quietly.

in the model

ε_H/ε_V. Calibrated with the full instrument on the ESPRIT statistics of Salamander (tools/decay_grid.py).

Hammer tilt

rebuild
polarization.hammer_tilt
0.0050.5default 0.05logrange ≈

How much the hammer also pushes the strings sideways.

in the model

Share of each string's hammer force on its horizontal oscillator.

Radiation

rebuild
polarization.radiation
0.011default 0.1logrange ≈

How much of the sideways vibration is heard.

in the model

Output weight of the horizontal bridge force (vertical = 1).

Scale (string lengths)

Break note

rebuild
scale.break_note
A0C8default 48 (C3)range ≈

Where the strings stop lengthening at the ideal rate: below, a grand's case is too short, so the bass strings are shorter and made heavier by winding.

in the model

Below this note the length goes linearly to len_a0.

Len a0

rebuild
scale.len_a0
0.14514.5default 1.45logrange ≈

Speaking length of the lowest string (A0).

in the model

End of the foreshortened bass segment (m).

Len c8

rebuild
scale.len_c8
0.00520.52default 0.052logrange ≈

Speaking length of the highest string (C8), between its two bearing points.

in the model

Lengths grow by ratio_per_octave per octave down to break_note. This generic 2 m grand scale is a placeholder, not a measured one. With the tension and the pitch it sets each string's mass: μ = T/(2·L·f0)².

Ratio per octave

rebuild
scale.ratio_per_octave
0.18518.5default 1.85logrange ≈

How much longer the strings get per octave down (2 would be the ideal, pure length scaling).

in the model

Length ratio per octave from C8 to the break note.

Tension

rebuild
scale.tension
757500default 750logrange ≈

Tension of each string (typically 700–900 N). Heavier, tenser strings push harder on the bridge.

in the model

The same T on every string. With L it sets μ, the bridge coupling (T/L)·Y, the damper impedance √(T·μ) and the hammer's modal masses.

Unisons

Bichord from

rebuild
unison.bichord_from
A0C8default 28 (E1)range ≈

Lowest key with two strings (below: one heavy wound string per key).

in the model

MIDI note. The strings of a key are coupled through the bridge (Weinreich 1977): double decay and beating.

String height spread

rebuild
unison.height_spread
05·10⁻⁴default 1·10⁻⁴ m

The strings of a key never lie exactly level: a slow hammer reaches them one after the other.

in the model

Height spread (m) of a unison's strings: string j takes no hammer force until h_j·spread/v (h_j in 0…1, irregular per key, v the hammer speed) (docs/release.md).

Hit spread

rebuild
unison.hit_spread
0.022default 0.2logrange ≈

The hammer never hits the strings of a key exactly evenly. The uneven part sets them swinging against each other, which feeds the long aftersound.

in the model

Relative spread of the force share each string gets (0: equal), a zero-mean pattern rotated per key. Set on the aftersound level of the treble (docs/sustain.md).

Soft exponent

rebuild
unison.soft_exponent
0.110default 1logrange ≈

A soft blow touches the strings of a key less evenly than a hard one, so soft notes keep their upper partials longer. 0: the same unevenness at every speed.

in the model

Spread = hit_spread·(soft_speed/v)^exponent, capped at 1 (v: hammer speed). Set on the early decay of the middle's upper partials at pp and ff on eight real grands (docs/release.md).

Soft speed

rebuild
unison.soft_speed
0.27527.5default 2.75logrange ≈

Hammer speed at which the unevenness is hit_spread; slower blows are more uneven.

in the model

Reference speed (m/s) of the soft-blow law.

Trichord from

rebuild
unison.trichord_from
A0C8default 45 (A2)range ≈

Lowest key with three strings.

in the model

MIDI note.

Width mid

rebuild
unison.width_mid
0.110default 1logrange ≈

The strings of a key are never exactly in tune with each other. This slight mistuning gives the piano's sustained, shimmering 'aftersound'; too much and notes sound out of tune or honky-tonk. Spread up to middle C.

in the model

Spread between the extreme strings (cents) up to C4, growing quadratically to width_treble at C8; each key gets an irregular but fixed pattern. 1 cent puts the aftersound 13–17 dB below the prompt sound (docs/long_sustain.md).

Width treble

rebuild
unison.width_treble
0.550default 5logrange ≈

Mistuning spread of the strings at the top key (C8).

in the model

Spread (cents) at C8; calibrated on the ESPRIT statistics of Salamander.