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
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
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
Unison · two strings, slightly apart
Unison spread
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
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 abovewound_until. The bass side of the soundboard now takes that energy (see the soundboard).top_slope, for the top strings, fromtop_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. Raisingtop_slopeshortens both.
Fundamental T60 (string losses alone)
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

Parameters
Losses
Wound-string loss floor
rebuildlosses.b1_floorExtra losses of the wound bass strings (copper wire wound around the steel core rubs on itself).
Added to σ below wound_until, fading over the octave above. 0.2 /s puts the bass envelopes within 1 dB of Salamander.
B1 offset
rebuildlosses.b1_offsetOverall sustain of the notes: lower values ring longer.
Offset of the log-linear term of σ.
B1 slope
rebuildlosses.b1_slopeHow much faster notes die away towards the treble, from the strings' own losses (air drag, internal friction). The soundboard adds its own.
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
rebuildlosses.b2How much faster the high overtones die than the fundamental: higher values make the sound darken sooner as it decays.
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
rebuildlosses.top_fromKey from which the top strings lose energy faster.
MIDI note where top_slope starts.
Top slope
rebuildlosses.top_slopeExtra 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.
σ'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
rebuildlosses.wound_untilHighest key with wound strings.
MIDI note where the b1_floor term starts fading (gone an octave higher).
Nonlinearity (phantom partials)
Enabled
rebuildnonlinear.enabledStruck hard, a string stretches as it swings, which adds 'phantom' overtones: the growl and brightness of a loud bass.
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
rebuildnonlinear.couplingLoudness of the phantom overtones.
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
rebuildnonlinear.coupling_cornerSlow changes of string tension barely move the board; this filters them out.
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
rebuildnonlinear.long_lossDamping of the stretching vibrations.
Loss factor of the longitudinal modes.
Max long
rebuildnonlinear.max_long_hzHighest stretching vibration kept (CPU).
Longitudinal modes kept (Hz).
Max note
rebuildnonlinear.max_noteHighest key computed: above, the phantom overtones are too high to matter.
MIDI note (E4: its first longitudinal mode is above 4 kHz).
Max partial
rebuildnonlinear.max_partial_hzHighest overtone taking part (CPU).
Transverse partials kept in the products (Hz).
Young
rebuildnonlinear.youngStiffness of the steel of the strings.
Young's modulus E (Pa); the core diameter follows from B: B = π³·E·d⁴/(64·T·L²), EA = E·π·d²/4.
Polarisations
Enabled
rebuildpolarization.enabledStrings 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.
Doubles the oscillators of each partial (vertical and horizontal) in the coupled unison system.
Cross
rebuildpolarization.crossHow 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.
ε_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
rebuildpolarization.detune_centsPitch difference between the sideways and up-and-down vibrations (the string's ends hold it differently in each direction).
Horizontal minus vertical frequency (cents).
H coupling
rebuildpolarization.h_couplingHow much the bridge gives sideways, relative to up-and-down. Low: the sideways motion rings long and quietly.
ε_H/ε_V. Calibrated with the full instrument on the ESPRIT statistics of Salamander (tools/decay_grid.py).
Hammer tilt
rebuildpolarization.hammer_tiltHow much the hammer also pushes the strings sideways.
Share of each string's hammer force on its horizontal oscillator.
Radiation
rebuildpolarization.radiationHow much of the sideways vibration is heard.
Output weight of the horizontal bridge force (vertical = 1).
Scale (string lengths)
Break note
rebuildscale.break_noteWhere 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.
Below this note the length goes linearly to len_a0.
Len a0
rebuildscale.len_a0Speaking length of the lowest string (A0).
End of the foreshortened bass segment (m).
Len c8
rebuildscale.len_c8Speaking length of the highest string (C8), between its two bearing points.
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
rebuildscale.ratio_per_octaveHow much longer the strings get per octave down (2 would be the ideal, pure length scaling).
Length ratio per octave from C8 to the break note.
Tension
rebuildscale.tensionTension of each string (typically 700–900 N). Heavier, tenser strings push harder on the bridge.
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
rebuildunison.bichord_fromLowest key with two strings (below: one heavy wound string per key).
MIDI note. The strings of a key are coupled through the bridge (Weinreich 1977): double decay and beating.
String height spread
rebuildunison.height_spreadThe strings of a key never lie exactly level: a slow hammer reaches them one after the other.
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
rebuildunison.hit_spreadThe hammer never hits the strings of a key exactly evenly. The uneven part sets them swinging against each other, which feeds the long aftersound.
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
rebuildunison.soft_exponentA 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.
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
rebuildunison.soft_speedHammer speed at which the unevenness is hit_spread; slower blows are more uneven.
Reference speed (m/s) of the soft-blow law.
Trichord from
rebuildunison.trichord_fromLowest key with three strings.
MIDI note.
Width mid
rebuildunison.width_midThe 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.
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
rebuildunison.width_trebleMistuning spread of the strings at the top key (C8).
Spread (cents) at C8; calibrated on the ESPRIT statistics of Salamander.