Files
midigrid/MidiGrid_PlayFromBar.lua
T
Talon fc378e733b 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.
2026-08-14 20:04:20 +02:00

13 lines
463 B
Lua

--[[
MIDI Grid: play from the start of the bar the cursor is in, and keep going.
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(false)
G.say("Playing from bar " .. bar)