Keyboard- and speech-driven step entry for the MIDI editor, built for use with OSARA. Arrows walk grid cells and scale degrees, Enter toggles notes, and every position is spoken and auditioned. Uses REAPER's own edit cursor and active_note_row rather than private cursor state, so grid mode and OSARA editing stay in sync. Grid size comes from MIDI_GetGrid(), so existing grid keybindings drive it. When grid mode is off, every bound key forwards to its previous action. Preview timing lives in a background daemon so the action scripts can exit immediately -- a script still alive on the next keypress triggers REAPER's "already running" prompt and breaks key repeat.
14 lines
468 B
Lua
14 lines
468 B
Lua
-- MIDI Grid: re-speak and re-sound the current cell without moving
|
|
local dir = ({ reaper.get_action_context() })[2]:match("@?(.*[\\/])")
|
|
local G = dofile(dir .. "midigrid_lib.lua")
|
|
|
|
local hwnd, take, err = G.editor()
|
|
if not take then G.say(err) return end
|
|
|
|
local ppqA, ppqB = G.cellPPQ(take)
|
|
local ps = G.pitchesInCell(take, ppqA, ppqB)
|
|
|
|
G.say(("%s, %s, cursor %s"):format(
|
|
G.cellPosText(take), G.cellContentText(take), G.noteName(G.getPitch(hwnd))))
|
|
G.preview(ps)
|