Add play-from-start-of-bar

Alt+Space plays from the downbeat of the bar the cursor is in. Auditioning a
cell says what a note is; playing from the bar line says whether it is in the
right place, which is the question that matters at 16ths and 32nds and cannot
be answered from a note in isolation.

REAPER can almost do this by chaining a go-to-measure action with play, but
that leaves the edit cursor at the bar line -- and the edit cursor is the grid
cursor, so you would lose your editing position every time you listened. Here
the cursor is moved just long enough to start playback and then restored with
seekplay=false so the restore cannot drag playback with it.

Works regardless of grid mode, being a listening aid rather than an edit.
This commit is contained in:
2026-08-14 19:57:55 +02:00
parent 51dff21e85
commit 8fd1b4755f
4 changed files with 68 additions and 2 deletions
+12
View File
@@ -0,0 +1,12 @@
--[[
MIDI Grid: play from the start of the bar the cursor is in.
Deliberately works whether or not grid mode is on -- it is a listening aid,
not an editing action, and it is just as useful while navigating with OSARA
normally. Stop with Space as usual.
]]
local dir = ({ reaper.get_action_context() })[2]:match("@?(.*[\\/])")
local G = dofile(dir .. "midigrid_lib.lua")
local bar = G.playFromBar()
G.say("Playing from bar " .. bar)