Skip to content

feat(editor): enable bpm edits in tempo map - #49

Merged
byrongamatos merged 1 commit into
editor-loop-handofffrom
editor-tempo-bpm
Jul 5, 2026
Merged

feat(editor): enable bpm edits in tempo map#49
byrongamatos merged 1 commit into
editor-loop-handofffrom
editor-tempo-bpm

Conversation

@ChrisBeWithYou

Copy link
Copy Markdown
Contributor

Summary

  • keep the BPM input active in Tempo Map mode instead of greying it out
  • edit the selected measure BPM through the existing tempo retime command path
  • cover selected-measure BPM reshaping with a focused Node test

Testing

  • node --check screen.js
  • node tests/loop_region.test.js
  • node tests/pending_view.test.js
  • node tests/tempo_map_bpm.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: a72ed2c2-b3a6-4099-90fa-5dad27e74096

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-bpm

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

@byrongamatos

Copy link
Copy Markdown
Collaborator

Review pass (Claude Code) — draft, top of the loop/tempo stack (#47#48#49). Its own changes (per-measure BPM editing in Tempo Map mode via _tempoSetMeasureBpmPure + TempoMapCmd) are correct: even sub-beat respacing = constant BPM across the measure, downstream measures rigid-shift by dt (preserving their own tempo), startT fixed, gapMin floor prevents zero-width measures. node --check + all JS tests green; Codex clean. No change needed here. (Inherits the loop-strip/tone-lane layout item flagged on #48.)

Signed-off-by: ChrisBeWithYou <chris@rifflarr.local>
@byrongamatos
byrongamatos force-pushed the editor-loop-handoff branch from 2fc2eaa to ebcd9d9 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 176e4e5 into editor-loop-handoff 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

This PR keeps the toolbar BPM input enabled while in Tempo Map mode and routes BPM edits to adjust the selected (or playhead-resolved) measure via the existing tempo remap/undo command path, with a focused Node test for the pure BPM-reshape helper.

Changes:

  • Call updateBPMDisplay() during draw() so the BPM input reflects tempo-map selection/playhead context.
  • Enable per-measure BPM editing in Tempo Map mode through editorSetBPM + TempoMapCmd.
  • Add a pure helper (_tempoSetMeasureBpmPure) and a Node test that validates measure BPM reshaping and tail shifting behavior.

Reviewed changes

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

File Description
screen.js Keeps BPM input active in Tempo Map mode, resolves which measure to display/edit, and applies per-measure BPM edits via tempo remap history.
tests/tempo_map_bpm.test.js Adds a Node test for the new pure tempo-map BPM reshaping helper block embedded in screen.js.

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

Comment thread screen.js
Comment on lines +4971 to +4975
if (document.activeElement === el) return;
if (S.tempoMapMode) {
const d = _tempoResolvedMeasureIdx();
const m = _tempoMeasures().find(mm => mm.i === d) || null;
if (m && !m.isLast && m.bpm > 0) {
Comment thread screen.js
Comment on lines +9179 to +9182
if (bpmEl.dataset.origTitle === undefined) bpmEl.dataset.origTitle = bpmEl.title || '';
bpmEl.title = S.tempoMapMode
? 'Edit the selected measure BPM in Tempo Map mode'
: bpmEl.dataset.origTitle;
Comment thread screen.js
updateBPMDisplay();
return;
}
S.history.exec(new TempoMapCmd(S.beats.map(b => ({ ...b })), newBeats, 'bpm'));
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