Hammer
Voicing, graded felt, weight, shank and strike point — what the hammer gives the string, and how it changes with how hard you play.
Everything a piano note becomes starts with a few milliseconds of contact: a felt-covered hammer, thrown by the key, hits the strings from below, squeezes against them and bounces off. How long it stays, how hard it pushes and how that push rises and falls decide which partials the string receives — the timbre, and how the timbre changes with how hard you play.
Felt is a nonlinear spring
The model follows Stulov’s measured hammers: the felt pushes back with
F = Q0 · [ up + α · d(up)/dt ]
where u is how much it is squeezed (in mm). With p around 4, doubling the compression multiplies the force by sixteen: a hammer thrown twice as fast does not only push twice as hard, its push gets shorter and sharper, and that is what brightens a forte. The second term is the hysteresis α — felt keeps part of the energy instead of springing back — which the contact solver applies in a form that can only remove energy, so the strike is stable whatever the settings.
Hammer felt is not uniform either. It is pressed onto the wooden molding under tension, and its density grows gradually towards the inside. The model adds a second, steeper power law for that inner felt:
F = Q0 · up + Qcore · upcore
with Qcore = core_hardness (2) × Stulov’s Q0 of the key and pcore =
core_p (7), the hysteresis acting on the whole. At small compressions the outer felt alone
answers; as the hammer goes deeper, the inner term takes over and the felt stiffens
continuously:
Felt under the string · middle C
core_depth_* = 0), so no jump at some dynamic.Before 0.2.0 the hammer had two layers instead: a hard core reached once the felt was compressed
by a depth d. Whether a dynamic sounded bright depended on whether it crossed that threshold,
and a tenth of a millimetre of depth turned a dark mezzo-forte into a bright one. Against eight
real grands the graded felt scores better, the bass’s mezzo-forte attack above all
(docs/felt.md). The
two-layer hammer is still there: give core_depth_bass, core_depth_mid and
core_depth_treble a depth, and the inner term becomes Qcore·(u − d)pcore,
felt only past d (with core_p 2.5 and core_hardness 30, the former hammer).
hardness is the voicing knob a technician has with needles and lacquer: it scales the
outer felt’s stiffness on every key (the inner felt keeps Stulov’s, whatever the voicing). The
slopes spread it across the keyboard — treble hammers are smaller and harder — on top of
Stulov’s own growth of Q0 with the key, and hardness_slope_top hardens the top octave and a
half further, as voicers do so that the highest notes ring out:
Felt stiffness Q0
hardness_slope_top = 0.2 voices the top hammers much harder, C8 some 600 times C6.Felt exponent p
p_offset and p_bass). The inner felt's exponent is core_p = 7 on every key.Weight and shank
A heavier hammer (hammer_mass_scale) stays longer on the strings at the same speed:
more energy, a fuller and rounder tone. Light hammers — fortepianos, small uprights — bounce
off sooner, for a thinner, quicker attack.
The hammer is not rigid either: its head sits on a wooden shank, about 13 cm long, that
bends. In the model shank_share (0.3) of the hammer’s mass is the shank’s, linked to the head
by a spring and a dashpot; the head swings against it at shank_freq (300 Hz), damped by
shank_loss. A short blow — the treble, about 0.5 ms — is over before the shank follows: it
meets the head almost alone. A long one — the bass, 3–4 ms — meets the whole hammer. This gives
the top notes their strength: the strings get 4.5 dB more at C8 (ff) and 2 dB less at C4. With
the top hammers voiced harder, the top’s attack against the middle’s comes within 1 dB of eight
real grands’ (it was 10.6 dB too weak with a rigid hammer,
docs/top_level.md).
Strike point
Where the hammer hits matters as much as how. A string struck at a point cannot start the partials that have a still point (a node) there:
Strike point · which partials the hammer feeds
strike_ratio = 0.12 of the string from the agraffe up to C6, moving 0.05 closer to it by C8 (middle C: 0.6091 m long, felt 6.207 mm wide). Partials with a node near the strike point are barely excited — at 0.12, the 8th, which would sound harsh. The felt's width trims the highest partials a little more. Click a bar to see that partial's shape.Tuning strike_ratio toward the end of the string brightens and thins the tone; further in,
it gets rounder. contact_width_scale widens the felt patch touching the string, a gentle
low-pass on the highest partials.
The default voicing keeps the outer felt softer than Stulov’s (
hardness0.3) and lets the denser inner felt give the bite at forte — the method and the measurements are in docs/felt.md, docs/middle_highs.md and docs/top_level.md.
In the application

Parameters
General
Felt contact width
rebuildcontact_width_scaleWidth of the felt that touches the string. A wide patch cannot excite very short waves on the string: fewer high harmonics, a softer tone.
Scales the contact width (8 mm at A0 to 4 mm at C8). Partial k is struck with sin(kπ·x0)·sinc(kπ·w/2L): a spatial low-pass.
Top felt depth (bass)
rebuildcore_depth_bassTwo-layer hammer only: thickness of soft felt over a hard core on the lowest hammer (A0). Thicker: it takes a harder stroke to get the bright bite. 0: a graded felt.
Top-felt depth d (mm) at A0, linear to the middle value at C4. The una corda deepens it.
Top felt depth (middle)
rebuildcore_depth_midTwo-layer hammer only: thickness of soft felt over the core at middle C.
Depth d (mm) at C4, the joint of the two linear segments (A0–C4, C4–C8).
Top felt depth (treble)
rebuildcore_depth_trebleTwo-layer hammer only: thickness of soft felt over the core on the highest hammer (C8).
Depth d (mm) at C8, linear from C4.
Inner felt hardness
rebuildcore_hardnessHammer felt is denser inside than outside. Played softly, only the soft outer felt is squeezed and the tone is round; played harder, the hammer works into denser felt and the tone brightens. This is how dense the inside is (0: one uniform felt).
Adds Q_core·(u − d)^p_core to the felt force, with Q_core = core_hardness × Stulov's Q0 of the key (whatever the voicing of the top felt). With d = 0 and p_core above the top felt's exponent, the felt is graded: it stiffens continuously (default 2, p_core 7, docs/felt.md). With d > 0 it is a two-layer hammer whose core is reached past d (docs/presence.md).
Inner felt exponent
rebuildcore_pHow fast the felt stiffens as it is compressed (graded felt), or how abruptly the core resists (two layers).
Exponent p_core of the inner term Q_core·(u − d)^p_core.
Hammer mass
rebuildhammer_mass_scaleWeight of the hammers. Light hammers (fortepianos, small uprights) bounce off the strings sooner: a thinner, quicker attack; heavy ones stay longer on the strings and give a fuller, rounder tone.
Multiplies Stulov's hammer masses (11 g at A0 down to 5.3 g at C8). The contact solver integrates m·x'' = −F, so at a given speed the strike's energy and duration grow with the mass.
Felt hardness
rebuildhardnessVoicing: how hard the hammer felt is. Harder felt gives a brighter, more percussive tone, softer felt a rounder, mellower one. Technicians voice a piano by needling or hardening the felt.
Multiplies the felt stiffness Q0 of every key in F = Q0·u^p (u: felt compression in mm), from Stulov's measured hammers (ICA 2009). The default 0.3 makes the top felt softer than his; the hard core underneath gives the bite at forte (docs/middle_highs.md).
Hardness slope (treble)
rebuildhardness_slopeHow quickly the hammers get harder from middle C to the top. Treble hammers are smaller and harder; more slope brightens the upper register.
Q0 ×= e^(slope·(key − 40)) above C4 (key 40, counting A0 as 1), on top of the growth of Stulov's fit, e^(0.045·key).
Hardness slope (bass)
rebuildhardness_slope_bassThe same, from middle C down to the lowest key. Positive values make the bass hammers softer than the middle ones, negative values harder.
Q0 ×= e^(slope·(key − 40)) below C4.
Hardness slope (top)
rebuildhardness_slope_topExtra hardness of the top octave and a half's hammers, which voicers harden so that the highest notes ring out.
Q0 ×= e^(slope·(key − 64)) above C6, on top of hardness_slope (docs/top_level.md).
Felt hysteresis
rebuildhysteresisFelt does not spring back the way it was squeezed: it keeps some of the energy. More hysteresis gives a rounder tone and a softer rebound.
Multiplies Stulov's hysteresis time α in F = Q0·[u^p + α·d(u^p)/dt]. The contact solver uses its linearised form, which only removes energy (passive by construction).
Extra felt exponent (bass)
rebuildp_bassMakes the bass hammers more nonlinear: rounder when played softly, biting when played hard.
Added to the felt exponent p, growing linearly from 0 at C4 to p_bass at A0.
Felt exponent offset
rebuildp_offsetHow fast the felt stiffens as it is squeezed, on every key. Higher values widen the gap between the soft and the loud timbre.
Added to Stulov's exponent p = 3.7 + 0.015·key of the top felt (published values 2–5).
Shank frequency
rebuildshank_freqHow stiff the shank is: the frequency at which the head swings against it.
Frequency (Hz) of the head-against-shank mode, k = m_r·(2πf)² with m_r the reduced mass.
Shank loss
rebuildshank_lossDamping of the shank's swing.
Loss factor of the head-against-shank mode (c = loss·m_r·2πf).
Shank share of hammer mass
rebuildshank_shareThe hammer's shank bends. In the treble the short blow meets the hammer head almost alone, which gives the top notes their strength; in the bass the whole hammer follows. Share of the hammer's mass in its shank (0: a rigid hammer).
The head (1 − share of the mass) is linked to the shank's effective mass by a spring and a dashpot; both start at the hammer speed (docs/top_level.md).
Strike point
rebuildstrike_ratioWhere the hammer hits the string, as a share of its length from the tuning-pin end. Near 1/8 it barely excites the 8th partial, which would sound harsh; closer to the end the tone gets brighter and thinner, further in rounder.
Strike point x0 = ratio·L up to C6, moving 0.05 closer to the agraffe by C8. Partial k is struck with sin(kπ·x0/L) (times the felt-width sinc): partials with a node at the strike point are not excited.