feat(editor): grouping-aware click, ruler ticks, and comb (P2-6) - #277
Merged
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAuthored meter groupings now generate accent maps used by metronome clicks, ruler ticks, and tempo suggestion scoring. Ungrouped bars retain downbeat-only behavior, and new tests cover grouping validation and each consumer. ChangesGrouping-aware timing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TempoMarks
participant Metronome
participant Ruler
participant TempoSuggest
TempoMarks->>Metronome: provide live grouping accent maps
TempoMarks->>Ruler: provide live grouping accent maps
TempoMarks->>TempoSuggest: provide measure accent maps
Metronome->>Metronome: accent grouped-cell clicks
Ruler->>Ruler: emphasize grouped subdivision ticks
TempoSuggest->>TempoSuggest: weight grouped-cell onset scores
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Jul 14, 2026
byrongamatos
changed the base branch from
feat/editor-markers-hold-group
to
main
July 15, 2026 20:28
The authored meter grouping's three consumers, so 2+2+3 actually teaches the riff: - Metronome: _metroClicksInWindowPure takes the measure→accent-map lookup (plain data, sliced-env safe) and accents grouping-cell starts; window-edge back-scan keeps mid-bar scheduler windows accent-correct. - Ruler: grouping accents draw bright at full tick density, and at far zoom (pxPerBeat < 6, pxPerBar >= 28) the sparse sub-bar ticks are SPENT on the accents (_rulerGroupTickPure) instead of vanishing. - Suggest comb: _suggestCombPure gains an accentMap — accented positions carry double weight, so a phase aligned with the FELT pulse out-scores even subdivision (and a WRONG grouping scores below the right one); threaded through the march + best-candidate probe via opts.accentsByMeasure, built from live marks in _suggestCompute. The shared lookup (_groupingAccentsLive) is memoized on the immutable marks array identity — no per-frame builds on the draw/scheduler paths. No grouping anywhere = bit-identical behavior (pinned). tests/grouping_aware.test.mjs (5 cases, fails on main): accent maps, by-measure lookup, click accents (incl. mid-window back-scan), grouped- beats-even comb ordering (right grouping > wrong grouping > none on an accent-only fixture), ruler tick gating. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
byrongamatos
force-pushed
the
feat/editor-grouping-aware
branch
from
July 15, 2026 20:31
aea8882 to
ecfeda8
Compare
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
P2-6 — the grouping field's three consumers, so an authored
7/8 (2+2+3)actually teaches the riff instead of just labeling it:2+2+3clicks strong-weak-strong-weak-strong-weak-weak, so you hear where the pick pattern resets.2+2+3accents out-scores one that merely matches an even seven. A wrong grouping (3+2+2against a2+2+3performance) scores below the right one — the detector genuinely prefers the authored feel.No grouping = bit-identical behavior everywhere (pinned by test): the accent map degrades to downbeat-only, the comb's uniform weights reproduce the exact old mean, the ruler draws what it always drew.
How
_groupingAccentMapPure([2,2,3], 7) → [1,0,1,0,1,0,0]+ a by-measure lookup intempo-marks.js; the live lookup (_groupingAccentsLive) is memoized on the immutable marks-array identity — no per-frame builds on the draw/scheduler hot paths._metroClicksInWindowPuregains the lookup as plain data (sliced-env safe); a window-edge back-scan keeps mid-bar scheduler windows accent-correct._suggestCombPure(…, accentMap)weighted mean; threaded through the march and the best-candidate probe viaopts.accentsByMeasure.Testing
tests/grouping_aware.test.mjs(5 cases, fails on main): accent-map shapes (incl. bad-sum degradation), lookup coverage, click accents incl. the mid-window back-scan, the comb ordering (right grouping > even > wrong grouping on an accent-only onset fixture) plus exact backwards-compat mean, ruler tick gating. Full suites green: 160 files / 0 fail, lint at baseline.🤖 Generated with Claude Code
https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
Summary by CodeRabbit
New Features
7/8grouped as2+2+3.Tests