mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
Second round of Lua script API updates
This commit is contained in:
parent
1abf6a77d6
commit
76c0f42ecb
23 changed files with 76 additions and 112 deletions
|
|
@ -2,15 +2,15 @@ ardour { ["type"] = "Snippet", name = "Dump MIDI Region" }
|
|||
|
||||
function factory () return function ()
|
||||
local sel = Editor:get_selection ()
|
||||
local tm = Temporal.TempoMap.read ()
|
||||
for r in sel.regions:regionlist ():iter () do
|
||||
local mr = r:to_midiregion ()
|
||||
if mr:isnil () then goto next end
|
||||
|
||||
print (r:name (), "Pos:", r:position (), "Start:", r:start ())
|
||||
local bfc = ARDOUR.BeatsSamplesConverter (Session:tempo_map (), r:position ())
|
||||
local nl = ARDOUR.LuaAPI.note_list (mr:model ())
|
||||
for n in nl:iter () do
|
||||
print (" Note @", bfc:to (n:time ()),
|
||||
print (" Note @", n:time (), tm:sample_at_beats (n:time ()),
|
||||
ARDOUR.ParameterDescriptor.midi_note_name (n:note ()),
|
||||
"Vel:", n:velocity ())
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue