Skip to content

Piano Roll and Score follow the playhead while playing or recording (fixes #150) - #156

Merged
fabox-os merged 1 commit into
mainfrom
review/issue-150-follow-playhead
Nov 22, 2026
Merged

fabox-os merged 1 commit into
mainfrom
review/issue-150-follow-playhead

Conversation

@fabox-os

Copy link
Copy Markdown
Owner

Fixes #150.

The Piano Roll and the Score only scrolled when the user scrolled. Once the playhead went outside the visible range, nothing brought it back, so the view stopped showing the playhead.

Change: while the transport plays or records, both views page when the playhead leaves the visible range, keeping it near the left edge (Logic's Page follow). Only the playhead inside the region being edited is followed. The rule is a pure function, piano_roll::follow_scroll, with unit tests for the visible, right-edge, left-edge and non-finite cases.

Not done: a UI option to turn follow off, and a test of the drawing code itself. Not checked on Windows 10 with a long imported MIDI file (the reporter's setup); it is the same code path, but it was not run.

🤖 Generated with Claude Code

…issue 150)

Both views only scrolled when the user scrolled, so once the playhead left the visible range
they stopped showing it. While the transport plays or records, the view now pages when the
playhead leaves it (keeping it near the left edge), as Logic's Page follow does. The playhead
is followed only while it is inside the region being edited.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@fabox-os
fabox-os merged commit b571eb3 into main Nov 22, 2026
10 checks passed
fabox-os pushed a commit that referenced this pull request Nov 22, 2026
main gained the offline bounce (#153) and the Piano Roll changes (#156) since this branch
started. Resolved: begun_bounce from main kept, the import doc comment kept, locale lines
unioned.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
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.

Sync Piano Roll/Score during playback/Record

1 participant