feat(editor): enable bpm edits in tempo map - #49
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
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 |
Signed-off-by: ChrisBeWithYou <chris@rifflarr.local>
2fc2eaa to
ebcd9d9
Compare
b5614b1 to
1513d94
Compare
There was a problem hiding this comment.
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()duringdraw()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.
| 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) { |
| 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; |
| updateBPMDisplay(); | ||
| return; | ||
| } | ||
| S.history.exec(new TempoMapCmd(S.beats.map(b => ({ ...b })), newBeats, 'bpm')); |
Summary
Testing