Add play-current-bar-only

Ctrl+Alt+Space plays the cursor's bar and stops at the next bar line, so the
same bar can be fired repeatedly while nudging a note without reaching for
stop. Alt+Space keeps its play-onwards behaviour.

The stop is performed by the preview daemon rather than the action script: a
script that stayed alive waiting for the bar to end would bring back REAPER's
"already running" prompt on the next press, which is the problem the daemon
exists to avoid. Stopping transport can move the edit cursor depending on
preferences, and the edit cursor is the grid cursor, so the daemon restores it.

A short arming window covers the gap between requesting playback and the
transport reporting as playing, so the pending stop is not cancelled instantly.
This commit is contained in:
2026-08-14 20:04:20 +02:00
parent 8fd1b4755f
commit fc378e733b
6 changed files with 71 additions and 14 deletions
+4 -2
View File
@@ -60,7 +60,8 @@ $actions = @(
@('RSmidigrid_shr', 32060, 'MIDI Grid: Shift all notes one cell right', 'MidiGrid_ShiftRight.lua'),
@('RSmidigrid_shlf', 32060, 'MIDI Grid: Shift all notes left (force)', 'MidiGrid_ShiftLeftForce.lua'),
@('RSmidigrid_shrf', 32060, 'MIDI Grid: Shift all notes right (force)', 'MidiGrid_ShiftRightForce.lua'),
@('RSmidigrid_playbar',32060, 'MIDI Grid: Play from start of current bar', 'MidiGrid_PlayFromBar.lua')
@('RSmidigrid_playbar',32060, 'MIDI Grid: Play from start of current bar', 'MidiGrid_PlayFromBar.lua'),
@('RSmidigrid_playone',32060, 'MIDI Grid: Play current bar only', 'MidiGrid_PlayBarOnly.lua')
)
# flags, keycode, section, id
@@ -88,7 +89,8 @@ $keys = @(
@(13, 32807, 32060, 'RSmidigrid_shr'),
@(29, 32805, 32060, 'RSmidigrid_shlf'),
@(29, 32807, 32060, 'RSmidigrid_shrf'),
@(17, 32, 32060, 'RSmidigrid_playbar')
@(17, 32, 32060, 'RSmidigrid_playbar'),
@(25, 32, 32060, 'RSmidigrid_playone')
)
$backup = "$kb.midigrid-backup"