T-039 — Release fit: damped decay rates from Salamander’s release samples replace the placeholder dampers

Status: done — H1–H5 accepted (maintainer, Dec 2026); model models/piano/salamander-c5/2026-12-01-r2/ · Area: julia, piano · Depends on: T-007

Read for that: T-007 (H5, Final), Piano 12 step 1 item 6, Piano 09 (dampers and note-off), Piano model file ([damper], partial.damped_decay), T-038 (the free rates the damped ones must exceed), training/src/ReferencePiano.jl.

Why: T-007 H5 gave every damped key a placeholder: T60 0.3 s at every partial. Since T-009 the plugin plays it, and a released note stops too abruptly and too evenly over the partials. Salamander recorded the release; this task fits it.

The data (checked before writing this page)

The backlog row named rel1–88. Those are not string decays: they are 0.46 s key and hammer release noises, one per key, which the SFZ plays at −37 dB without pitch tracking (pitch_keytrack=0). They belong to the noises of T-010 (Piano 10).

The damped string sound is in the harm* samples (“string resonance releases in minor thirds in three layers”, Salamander README): harmL<note> (loud, SFZ velocity ≥ 45), harmS<note> (soft, < 45), harmV3<note> (a third, quieter layer), each at the 23 sampled keys A0 … D#6 (MIDI 21–87), 69 files of 1.9–2.8 s, stereo, the same two mics. D#6 is the last key with a damper sampled; Yamaha C5 has none from F#6 (MIDI 90) up, as T-007 assumed. Each file starts while the note still rings, 0.05–0.4 s before the decay sets in, and falls 25–40 dB within about 0.5 s.

A first look (Python, one mic, peak per partial in ±2 % of , slope over 0.25 s after the peak; not the fit):

samplepartials 1–8: damped T60 over the first 0.25 s (s)after 0.4 s
harmLA01.1, 3.8, 1.4, 6.4, 1.4, 0.5, 0.4, 0.8−1 … −20 dB/s
harmLC41.0, 0.9, 0.4, 1.0, 0.4, 2.7, 0.6, —−16 … −45 dB/s
harmSC41.8, 1.4, 0.6, 0.9, 1.0, 3.4, 0.9, 0.8
harmLA50.6, 1.7, 7.3, 1.0, … (from n = 5 at the noise floor)
harmLD#61.2, 4.4, 1.0, 0.9, 0.7, …

So: damped T60s of 0.4–2 s, 1.3–7× the placeholder, uneven over the partials; a few partials barely damped (C4 n = 6, D#6 n = 2, A0 n = 2 and 4); and after the first 25–40 dB a slow residual of −1 … −45 dB/s. Candidates for both: partials with a node near the damper’s contact line (a damper cannot damp them), the other strings of the unison, sympathetic strings without dampers, the room.

What

  1. Analysis (InstrumentsTraining.ReleaseFit, driver training/scripts/t039_release_fit.jl): per harm* sample and mic, the partial envelopes at the frequencies of the reference (ReferencePiano’s tables at that key) with NoteAnalysis.partial_envelopes; the damping onset (the time the broadband level starts to fall) and per partial a fit of the damped part (H2) above the noise floor; the level of the residual and when it takes over.
  2. Law over the keyboard (H3): the damped rates as smooth curves over key and partial frequency, fitted robustly over the three layers and both mics; extended to E6 and F6 (no sample) and never below the free rate.
  3. Reference and model (H4, H5): ReferencePiano.expand takes the fitted damped rates instead of DAMPED_T60; the model directory is rebuilt with [damper] placeholder = false, its golden vectors regenerated (their releases change); Rust’s golden tests and the plugin point to it.
  4. Check: render each harm* situation with the reference (the key at the layer’s velocity, released at the sample’s damping onset) and compare the per-partial envelopes after the release with the recording; listen.

Decisions

QuestionOptionsProposal
H1Which samples(a) the harm* samples (69, 23 keys, 3 layers) for the damped rates; rel1–88 go to T-010 as release noises; (b) rel1–88 as the backlog row said(a): rel1–88 hold no string decay (above); the backlog row and Piano 12 are corrected
H2What the damped decay is in the model(a) one damped rate per partial (format v1 as it is: partial.damped_decay, switched at the note-off), fitted to the first 25–30 dB after the damping onset; the residual and the onset delay are measured and reported, not modelled; (b) (a) plus a second, slow damped component per partial for the residual: needs a format change (v2) and Rust; (c) (a) plus a damper delay or ramp (the felt’s travel and absorption, tens of ms, Piano 09): a new manifest field and a time-varying rate in the engine (format change)(a): it is what format v1 and the engine already do, the first 25–30 dB are what a listener hears of a release in a passage, and the residual’s cause is open (it overlaps with sympathetic resonance, T-010). The measured delay and residual go into the results and, if they matter when listening, into a problem-log entry
H3How the rates are smoothed and filled(a) per key a law fitted robustly (Huber, like T-006’s laws) over the partials of the three layers and both mics, then , as piecewise-linear curves over the 23 sampled keys (curve.damper_* in the model file for documentation), per-partial outliers (barely damped partials) not kept; (b) per-partial rates at sampled keys kept exactly (like the amplitudes, T-007 H3), law only between keys; (c) one rate per key for all partials(a): per-partial damped rates are noisy (one slope over ~0.3 s, partials near the floor), and a barely damped partial kept at one key would ring after release at that key only; (b) if the check shows the law misses audible structure
H4Damped rate of the three components and of the free rate(a) all components of a partial (prompt, slow, partner) get the same damped rate , as now; (b) the damper’s damping added: (a): the fit measures the total decay after release, and the free rates are 10–100× smaller, so (b) changes nothing measurable
H5Where the new model goes(a) a new version directory models/piano/salamander-c5/2026-12-01-r2/ (model_version the same string as the directory name), plugin and tests switched to it, the old directory deleted (it stays in Git history); (b) keep both directories in the tree; (c) overwrite 2026-12-01/ in place(a): a model directory never changes once committed (golden vectors are tied to it), and one model in the tree keeps the plugin, the tests and the vault pointing at the same thing

All five proposals accepted by the maintainer (Dec 2026).

Done when

Tests first: on synthetic release envelopes (a free decay that switches to a known damped rate at a known onset, plus a residual and noise) the analysis recovers the onset to 10 ms and the rates to 5 %; the law fit recovers known , from noisy per-partial rates with outliers; expand uses the fitted rates (damped ≥ free, keys without damper unchanged); the reference’s release matches the closed form with the fitted rates. Julia tests, Rust gates (golden tests against the new directory), plugin gates (bundle, clap-validator) green.

A results section here: per register the damped T60s (law and per-sample spread), the onset delay, the residual’s level and slope, the envelope error of the reference’s releases against the recordings, notes from listening; training/results/salamander/t039_damper.csv (per sample and partial) and the law in curves; the new model directory with [damper] placeholder = false; Piano 12 (item 6 done), the Piano model file page and the backlog row (harm*, not rel1–88) updated; rel1–88 noted under T-010.

Results

Code: InstrumentsTraining.ReleaseFit (level_db, damping_onset, damped_rate, fit_damper_law, damper_rate; tests in training/test/releasefit.jl: onset to 10 ms and rates to 5 % on synthetic releases with a residual and noise, the law from noisy rates with outliers, expand with the law). ReferencePiano.expand(...; damped_rate) takes the law; piano_manifest(...; damper) and piano_tensors(...; extra_curves) carry it into the model file. Driver training/scripts/t039_release_fit.jl (fit: 69 samples in 4 s plus loading); t007_reference_piano.jl build reads t039_damper.toml and writes 2026-12-01-r2/. Tables: training/results/salamander/t039_damper.{toml,csv}, t039_samples.csv (README there).

One refinement of H3 while fitting: the per-key slopes were not determined above C4 (6–30 usable rates per key; swung between −0.9 and +0.4, giving T60s of 1–6 s at one key), while every well-determined key had . The law now has one for all keys (a robust pooled fit with per-key intercepts) and holds inside each key’s measured range. The pooled slope is : within a key the damped rate is practically independent of the partial’s frequency, unlike Piano 09’s “high partials go first”.

Damped T60 of the law (first 30 dB after the onset; s):

keyslawmeasured, partials 1–4 of all layers: median [p10, p90]
A0–G#21.1–1.41.3–3.7 [0.6–1.7, 3.1–6.3]
A2–B31.1–1.31.3–1.6 [0.7–1.0, 2.0–4.0]
C4–F#51.4–2.71.4–3.2 [0.8–1.6, 2.8–5.9]
G5–D#61.7–2.51.7–2.6 [1.1–1.3, 3.2–4.2]

So the placeholder’s 0.3 s was 4–9× too short. The spread per key is large (a factor of 2–4 between p10 and p90): single rates differ from the law by a median absolute log ratio of 2.7–4.0 dB, with barely damped ones among them (C4 n = 6, D#6 n = 2), which H3 drops on purpose. With a 15 dB span instead of 30, the T60s are 10–25 % shorter: the decay is concave, faster over its first 10–15 dB.

Layers: the quiet layer V3 reads 1.5–2.6 s (median of partials 1–8) against 1.0–1.7 s for L and S below G5. A quiet release reaches the residual (an absolute level) sooner, so the law uses only rates measured over at least 20 dB.

Envelope error over each fitted span (a line at the table’s rate through the first frame against the recording’s envelope, median over partials; rms_law_db): 6.0–7.9 dB with the law, 47–107 dB with the placeholder.

Onset and residual (broadband, both mics; medians [p10, p90] per register A0–G#2 / A2–B3 / C4–F#5 / G5–D#6): slope after the onset −38 / −42 / −24 / −18 dB/s; level 1 s after the onset −24 / −27 / −17 / −15 dB [−38 … −9]; then a residual falling at −13 / −12 / −11 / −7 dB/s (T60 4–9 s), not modelled (H2). The damper delay is not measurable from these files: they start 0.01–0.16 s (median 0.04 s) before the decay sets in, but the key-up time is not recorded.

The model: models/piano/salamander-c5/2026-12-01-r2/, the same tables as 2026-12-01/ except partial.damped_decay and the curves damper_a, damper_b; [damper] placeholder = false; golden vectors regenerated (they differ from the first damping event at 0.70 s on). 2026-12-01/ is deleted (H5). Rust: model-format, dsp golden and plugin tests point to r2; three tests that timed the placeholder’s decay now allow for a T60 of ~1.5 s (C4 below −120 dB within 4 s instead of 1.5 s). clap-validator 35 passed, 0 failed, 9 skipped.

Listening: data/t039/release_<C2|C4|A4>_placeholder_then_fitted.wav (held 1 s, released; the placeholder, then the law); not yet heard by the maintainer. The residual, the knock of rel1–88 and the damper’s own noise are not in the model, so a release now fades smoothly instead of stopping.

Follow-ups: the residual after the first 30 dB and the concave decay (two damped stages per partial would need format v2), and the release noises rel1–88: both with T-010 (noises, sympathetic resonance). Velocity does not enter the damped rate.