print debugging for macOS/curl issues
[ardour.git] / scripts / _dump_midiregion.lua
1 ardour { ["type"] = "Snippet", name = "Dump MIDI Region" }
2
3 function factory () return function ()
4         local sel = Editor:get_selection ()
5         for r in sel.regions:regionlist ():iter () do
6                 local mr = r:to_midiregion ()
7                 if mr:isnil () then goto next end
8
9                 print (r:name (), "Pos:", r:position (), "Start:", r:start ())
10                 local bfc = ARDOUR.BeatsFramesConverter (Session:tempo_map (), r:position ())
11                 local nl = ARDOUR.LuaAPI.note_list (mr:model ())
12                 for n in nl:iter () do
13                         print (" Note @", bfc:to (n:time ()),
14                         ARDOUR.ParameterDescriptor.midi_note_name (n:note ()),
15                         "Vel:", n:velocity ())
16                 end
17                 print ("----")
18                 ::next::
19         end
20 end end
21