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)
|