--[[ MIDI Grid: play only the bar the cursor is in, stopping at the bar line. The stop is carried out by the preview daemon rather than here, because an action script must exit immediately -- one that stayed alive waiting for the bar to end would trigger REAPER's "already running" prompt on the next press. ]] local dir = ({ reaper.get_action_context() })[2]:match("@?(.*[\\/])") local G = dofile(dir .. "midigrid_lib.lua") local bar = G.playFromBar(true) G.say("Playing bar " .. bar .. " only")