feat(editor): chord-at-cursor readout at the playhead - #130
Conversation
DAW roadmap 4.17 (the chord-at-cursor third; passive key hints + fill-blanks deferred to a follow-up). A small, read-only chord name next to the measure display, naming whatever sounds at S.cursorTime. - @pure:chord-id: a common triad/seventh/sus/power-chord vocabulary matched EXACTLY against the sounding pitch-class set, so a name shows only when it's certain. `_pcSetFromMidisPure` collapses octave doublings; `_identifyChordPure` tries every root and uses the bass pitch class to break the genuine ties (m7-vs-6 share one pc-set — Cm7 over Eb = D#6; symmetric aug/dim7). Sharp spelling (enharmonic-correct labels are a separate 4.16a item). `_notesSoundingAtPure` gathers notes ringing at the time (onset-inclusive, sustain-aware, zero-sustain notes linger a min-dur so a struck chord registers). - updateChordDisplay: resolves fretted parts to sounding pitch (capo/tuning via _rollMidiForNote + _rollPitchCtx), keys parts to their packed pitch; shows the name, "—" when notes form no named chord, blank when silent. Wired into updateTimeDisplay; new #editor-chord-display span. Drum/tempo modes show nothing. Never edits. Tests: tests/chord_at_cursor.test.js (11) — pc-set dedupe, triads/7ths/sus/dim/ aug/power, the m7-vs-6 and sus2-vs-sus4 bass disambiguation, unmatched→null, the sounding window (onset-inclusive, sustain, gaps, NaN), and an end-to-end 6-string E voicing. All fail on main. Full JS suite green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HzMBtxWnLGHYkMMXtK38Bg
|
Warning Review limit reached
Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a read-only chord-at-cursor readout with a new toolbar display, pure chord-identification logic in ChangesChord-at-cursor readout
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Memoize the playhead chord readout so it stops rescanning all notes on every playback rAF: cache the readout plus the [lo,hi) sounding-set stability interval (_soundingIntervalPure) and reuse it while the cursor stays inside it. Cache validity (_chordCacheHitPure) invalidates on edit, arrangement swap, a fresh notes-array identity (song load/replace), or any active drag (move retime OR sustain resize). DOM writes guarded. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
…cursor # Conflicts: # CHANGELOG.md
DAW roadmap 4.17 — the chord-at-cursor third of the item. (Passive key hints + fill-blanks deferred to a follow-up so this stays atomic.) Editor-only.
What
A small, read-only chord name appears next to the measure display, naming whatever sounds at the playhead —
C,Am,Gmaj7,D#6,Csus4,E5, …@pure:chord-id): common triads, sevenths, sus, and the power-chord dyad, matched exactly against the sounding pitch-class set — so a name shows only when it's certain.—when notes sound but form no named chord; blank when nothing sounds.m7and6are the same four pitch classes (a Cm7 voiced over E♭ is D#6); augmented and dim7 are symmetric. The lowest sounding pitch class picks the spelling. (Sharp spelling throughout — enharmonic-correct labels are the separate 4.16a item.)_rollMidiForNote+_rollPitchCtx); keys parts use their packed pitch; octave doublings collapse._notesSoundingAtPuregathers notes ringing at the time (onset-inclusive, sustain-aware, zero-sustain notes linger a min-dur so a struck chord registers).updateTimeDisplay; new#editor-chord-displayspan. Drum/tempo modes show nothing. Never edits.Tests —
tests/chord_at_cursor.test.js(11, all fail on main)pc-set dedupe/rounding; triads, sevenths, sus, dim, aug, power chords; the m7-vs-6 and sus2-vs-sus4 bass disambiguation; unmatched clusters →
null; the sounding-window predicate (onset-inclusive, sustain, gaps, NaN, non-array); and an end-to-end 6-string E-major voicing naming asE. Full JS suite green.Scope / fresh region
New
@pure:chord-idblock after@pure:measure-readout, aupdateChordDisplaybesideupdateMeasureDisplay, one call inupdateTimeDisplay, and one HTML span. No core, no spec; no overlap with the open PRs (#112/#125/#126/#127/#128/#129).Summary by CodeRabbit
New Features
Tests