Skip to content

feat(editor): add tempo map signature control - #50

Merged
byrongamatos merged 1 commit into
editor-tempo-bpmfrom
editor-tempo-timesig
Jul 5, 2026
Merged

feat(editor): add tempo map signature control#50
byrongamatos merged 1 commit into
editor-tempo-bpmfrom
editor-tempo-timesig

Conversation

@ChrisBeWithYou

Copy link
Copy Markdown
Contributor

Summary

  • add a compact Sig control in Tempo Map mode for direct selected-measure beat-count edits
  • keep the existing bracket hotkeys/context menu paths backed by the same undoable grid command
  • cover beat-count resubdivision with a focused Node test

Notes

  • this edits the persisted beat-grid measure count only; denominator support needs the later song timeline/time_signatures model integration

Testing

  • node --check screen.js
  • node tests/loop_region.test.js
  • node tests/pending_view.test.js
  • node tests/tempo_map_bpm.test.js
  • node tests/tempo_map_timesig.test.js

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c04416fe-a4d7-43ea-b36c-833cff5d9f9f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch editor-tempo-timesig

Comment @coderabbitai help to get the list of available commands.

@byrongamatos

Copy link
Copy Markdown
Collaborator

Review pass (Claude Code) — draft, stacked on #49. Its own change (the Sig beat-count control via _tempoSetBeatsPerMeasurePure + TempoGridCmd) is correct: it replaces a measure's interior with count-1 evenly-spaced beats between the fixed downbeats (constant tempo, right beat count), count=1 yields a bare 1-beat measure, and the final measure uses duration as the closing boundary. Interior beats are tagged measure: -1, which every consumer treats identically to a <= 0 sub-beat, and _tempoRenumberMeasures leaves them untouched. node --check + all JS tests green. No change needed. (Codex second-opinion was unavailable — rate limit — so this is manual + test-backed.)

Signed-off-by: ChrisBeWithYou <chris@rifflarr.local>
@byrongamatos
byrongamatos force-pushed the editor-tempo-timesig branch from ac32314 to fc43f6c Compare July 5, 2026 12:24
@byrongamatos
byrongamatos marked this pull request as ready for review July 5, 2026 12:30
Copilot AI review requested due to automatic review settings July 5, 2026 12:30
@byrongamatos
byrongamatos merged commit 0be7230 into editor-tempo-bpm Jul 5, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a compact time-signature (“Sig”) control to Tempo Map mode, wiring it through the existing undoable tempo-grid editing path and adding a focused Node-based test for the pure resubdivision helper.

Changes:

  • Render/update a new “Sig” input in the toolbar during Tempo Map mode, and expose window.editorSetTempoSignature.
  • Extract a pure helper _tempoSetBeatsPerMeasurePure (with @pure: markers) and route the existing grid command through it.
  • Add tests/tempo_map_timesig.test.js to validate resubdivision behavior and clamping.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
screen.js Adds the Sig UI control + display updates, exposes editorSetTempoSignature, and extracts/tests a pure resubdivision helper for beat-grid time-signature edits.
tests/tempo_map_timesig.test.js New Node test covering beat-count resubdivision, clamping, and final-measure duration boundary behavior for the new pure helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread screen.js
Comment on lines 1084 to +1086
_renderLoopStrip();
updateBPMDisplay();
updateTempoSigDisplay();
Comment thread screen.js
Comment on lines +5109 to +5112
const prev = _tempoMeasureBeatCount(d);
_tempoSetBeatsPerMeasure(d, n);
updateTempoSigDisplay();
const next = _tempoMeasureBeatCount(d);
Comment thread screen.js
Comment on lines 9501 to 9504
_tempoRenumberMeasures(newBeats);
S.history.exec(new TempoGridCmd(beats.map(b => ({ ...b })), newBeats, 'timesig'));
updateTempoSigDisplay();
draw();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants