feat(editor): harden the assisted-tempo suggest engine (tempo PR 7) - #231
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAssisted tempo mapping now uses beat-relative snap windows, full-bar onset corroboration, median drift tracking, explicit stop details, and updated HUD messaging. Tests cover snapping, confidence, drift, stopping conditions, tempo bounds, and HUD text. ChangesAssisted tempo mapping
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant OnsetStream
participant _suggestFitPure
participant _suggestCompute
participant TempoMapHUD
OnsetStream->>_suggestFitPure: provide beat onsets
_suggestFitPure->>_suggestFitPure: corroborate bars and track drift
_suggestFitPure-->>_suggestCompute: return proposals and stop details
_suggestCompute->>TempoMapHUD: expose suggestion state
TempoMapHUD->>TempoMapHUD: render stop-specific guidance
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
The onset-fit march (Suggest ▸ G) now reads music the way a transcriber
would — it stops guessing where the audio stops agreeing instead of
snapping the grid onto syncopations or a single bad transient. All in
the pure fence (src/tempo-suggest.js); _suggestFitPure's signature is
unchanged (opts bag), so PR 8 can still build on it.
- c1 beat-relative window: the snap window is now a fraction of the
BEAT (gridInt/beatsInBar), not the whole bar — the old ±12%-of-bar was
±0.48 beat in 4/4 and scaled with meter, so a syncopation could be
snapped as the downbeat. New _suggestBeatWinPure; still floored at 25ms.
- c2 one-bar comb corroboration (_suggestCombPure): a candidate downbeat
is scored by the onset support of ALL the bar's implied beats, not the
single downbeat onset.
- c6 confidence is a PRODUCT of comb × continuity × consistency, so a
bare-downbeat or off-tempo bar reads as less certain than a fully-
played, steady one.
- c3 median stretch (_suggestMedianPure) resists one bad snap the way a
plain EMA (α=0.35) could not; a single correction > 25% of a bar STOPS
(stopDetail 'tempo-jump') rather than dragging the whole grid.
- c4 phase: a snap implying ~half/double the bar is a metric-phase
ambiguity (halftime backbeat, double-time hat) — stop ('phase').
- c5 miss classification (_suggestAnyOnsetInPure): a bar with NO onset is
silence — stop ('silence'); a bar whose onsets just miss the downbeat is
sustained — keep marching. Trailing-drop now keys on a miss flag, not
confidence, so a real low-comb hit survives.
- c7 named refusals: out-of-range tempo (outside 40-300 BPM) stops
('bpm-range'), and _suggestHudTextPure names each stop reason in the HUD
(_suggestStopDetail wired through tempo.js).
tests/tempo_suggest.test.mjs: +7 fixtures, one per failure mode, each
verified to FAIL on the pre-hardening engine (c1 grabs the syncopation,
c2 scores equal confidence, c3-c7 lack the stops). The existing drift
fixture was updated to a fully-played onset stream so the new comb
confidence is exercised (deliberate pin update). 118 JS green, lint
0-err. Verified live: Suggest on AC/DC proposed 96 barlines, ghosts
render, no errors.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
ChrisBeWithYou
force-pushed
the
feat/editor-suggest-hardening
branch
from
July 12, 2026 22:54
eb8fd3b to
5c6910b
Compare
byrongamatos
added a commit
that referenced
this pull request
Jul 15, 2026
…272) The #231 scope-note follow-up: misses bridged BETWEEN two corroborated hits are retroactively lifted to 75% of the weaker flank's INTRINSIC strength (comb x consistency — the closing hit's published conf is already continuity-penalized for the very gap being backfilled, so using it would double-count). Trailing misses keep the floor and still drop; locked pins corroborate at full trust; backfilled bars never outrank a real hit. Claude-Session: https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q Co-authored-by: ChrisBeWithYou <chris@rifflarr.local> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: byrongamatos <xasiklas@gmail.com>
This was referenced Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Tempo-track PR 7 (charrette rhythm c1–c7). Hardens the assisted-mapping onset-fit engine (Suggest ▸ G) so it reads music the way a transcriber does — stopping where the audio stops agreeing instead of snapping the grid onto syncopations or a single bad transient. Everything is in the pure fence (
src/tempo-suggest.js);_suggestFitPure's signature is unchanged (opts bag), so PR 8 can still build on it.The seven changes
gridInt/beatsInBar), not the bar (_suggestBeatWinPure)_suggestCombPure)_suggestMedianPure) + a single >25%-of-a-bar correction stopsphase)_suggestAnyOnsetInPure): silent bar stops, sustained bar marchesbpm-range); the HUD names each stop reasonSuggestions stay proposal-only (ghost poles) — nothing commits without an accept.
Verification
npm test— 118 pass.tests/tempo_suggest.test.mjsgains 7 fixtures, one per failure mode, each verified to FAIL on the pre-hardening engine (c1 grabs the syncopation → 4.35 vs 4.0; c2 scores equal confidence; c3–c7 lack the stops). The pre-existing drift fixture was updated to a fully-played onset stream so the new comb confidence is exercised — a deliberate pin update, called out in the diff.npm run lint— 0 errors (3 pre-existing ratchet warnings).Note (scope)
c5's retroactive confidence backfill for a re-entering sustained passage is not included — the stop/march classification is, but back-filling a prediction's confidence when a later onset confirms it is a follow-up. Everything else in c1–c7 lands here.
🤖 Generated with Claude Code
Summary by CodeRabbit