Files
STSheets/docs/experiments/2026-10-31-accuracy.md
T
2026-10-30 21:14:35 +01:00

4.3 KiB
Raw Blame History

Accuracy experiments — 2026-10-31

Branch exp/accuracy. Every experiment is judged on both the synthetic tiers (median merged-guitar pitch F1, ±50 ms) and the real reference song Last Night on Earth (lnoe, the only reference with a trustworthy alignment: constant +0.03 s, precision 93%). Swimming/Holes alignments are still flagged and are not used for decisions.

Baseline before these experiments: synthetic full-mode guitar F1 t1a 0.43 · t1b 0.51 · t1c 0.39 · t1d 0.60; lnoe guitar F1 0.390.

# Experiment Synthetic (median guitar F1) lnoe guitar F1 Verdict
E1 Transcribe guitar from Demucs guitar + piano + other (instead of guitar stem only) t1a 0.87 · t1b 0.81 · t1c 0.73 · t1d 0.72 0.403 Adopted (commit 0f14fbc). Big synthetic gain is mostly a SONiVOX-timbre artefact (Demucs routes the synth guitar to piano/other); real gain is small but positive. t1a now passes.
E2 Basic Pitch thresholds grid (onset 0.3–0.6, frame 0.2–0.4, min note 58/100 ms) best ≈ default (0.5/0.3/58) best 0.411 vs 0.403 Not adopted — defaults are at the optimum on both.
E3 Error taxonomy — fp: 46% no reference note near, 16% octave, 21% 50–150 ms timing; fn: 47% different pitch at the onset (partial chords), 25% octave, 24% missed Octave fixing upper bound only 0.40 → 0.46 (pitch-class F1) with no systematic direction.
E4 Complete partial strummed chords to standard guitar voicings (open + E/A-shape barres; maj/min/5/7/m7/sus/maj7) −0.03…+0.03 +0.016 (min 3 notes) Not adopted yet — small, single-song evidence.
E5 Repetition voting on the guitar transcription (src/pipeline/repeat.ts): bars of the estimated grid are repeats when their 16th-slot × pitch occupancy is similar (cosine ≥ 0.6, smoothed ±1 bar along the diagonal) and ≥ 30% of notes match exactly (pitch, ±50 ms); per bar, drop notes found in < 15% of its repeats, add notes found in ≥ 25% and ≥ 3 repeats t1a 0.885 · t1b 0.840 · t1c 0.752 · t1d 0.737 (+0.016…+0.026) 0.507 (P 0.45→0.53, R 0.37→0.49) Adopted (commit 132659a), default on for guitar (createPipeline(models, { repeatVote })).

Learnings

  • Synthetic gains do not transfer 1:1 to real recordings while the synthetic guitar is the SONiVOX GM patch; a more realistic guitar sound in the renderer would make the synthetic benchmark more predictive.
  • On real audio the limits are Basic Pitch's partial-chord recall on strummed rhythm guitar and octave confusions, not thresholds.
  • An undocumented MT3 ONNX export exists (HF ModernMube/HTDemucs_onnx, ~300 MB); not pursued — input/token format would need reverse-engineering and MT3 is weak on real recordings.
  • E5 repetition voting: the two halves behave differently. Dropping non-recurring notes is what helps synthetic (precision; t1 A-sections have only 2 repeats, so the add rule — which needs ≥ 3 — never fires there). On lnoe adding is the big win (add-only, before the exact-match gate: recall 0.37 → 0.56, F1 0.500): Basic Pitch drops different chord tones in each repeat of a strummed part, so the union across repeats completes chords (cf. E3/E4). The add thresholds are therefore tuned on one real song — re-check when another trustworthy alignment exists.
  • Controls: treating every bar as a repeat (no repetition detection) gives lnoe 0.440 and wrecks synthetic (t1a 0.48), so the gain comes from the detected repeats, not from song-level note priors.
  • Voting needs an accurate grid. With only the coarse (slot ±1) similarity, a 1% tempo error made distant bars "similar" but 40 ms/bar misaligned and dropped lnoe to 0.23; the exact-match gate (≥ 0.3) turns that case into a no-op (0.403). A per-pair time-shift search (±½ beat) to absorb drift picked spurious shifts and cost 0.03 on lnoe — not used. Half/double/1.5× tempo errors and ¼–½ beat downbeat errors still gain (lnoe 0.44–0.51).
  • Evaluated on cached transcriptions + estimated grids (.scratch/exp/cases_full.ts, baseline reproduces E1: 0.866 · 0.814 · 0.734 · 0.721); full pipeline spot check t1c/1 0.708 → 0.751 matches.
  • Per-song effect is not uniformly positive (t1a/2 −0.011, t1d/5 −0.026); medians and lnoe improve.

Experiment scripts live in the git-ignored .scratch/exp/.