diff options
author | Robin Gareus <robin@gareus.org> | 2016-07-10 16:48:38 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-07-10 16:48:38 +0200 |
commit | 4bb54f4128027435a8c87e99241a19e3327cc517 (patch) | |
tree | 56abf951c87c26fc75f829e59a75cb68d44456f0 /scripts/rawmidi.lua | |
parent | 7745a373940a0bcabd618b5b66c6b8916045ea9e (diff) |
refine lua-script documentation
Diffstat (limited to 'scripts/rawmidi.lua')
-rw-r--r-- | scripts/rawmidi.lua | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/scripts/rawmidi.lua b/scripts/rawmidi.lua index 73e62ef243..3b1dfb1d68 100644 --- a/scripts/rawmidi.lua +++ b/scripts/rawmidi.lua @@ -16,18 +16,24 @@ end function dsp_has_midi_input () return true end function dsp_has_midi_output () return true end +-- "dsp_runmap" uses Ardour's internal processor API, eqivalent to +-- 'connect_and_run()". There is no overhead (mapping, translating buffers). +-- The lua implementation is responsible to map all the buffers directly. function dsp_runmap (bufs, in_map, out_map, n_samples, offset) - local ib = in_map:get(ARDOUR.DataType("midi"), 0); -- get id of input buffer - local ob = in_map:get(ARDOUR.DataType("midi"), 0); -- get id of output buffer + -- see http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:ChanMapping + local ib = in_map:get (ARDOUR.DataType ("midi"), 0); -- get index of the 1st mapped midi input buffer + local ob = in_map:get (ARDOUR.DataType ("midi"), 0); -- get index of the 1st mapped midi output buffer assert (ib ~= ARDOUR.ChanMapping.Invalid); - assert (ib == ob); -- inplace, buffers are identical + assert (ib == ob); -- require inplace, buffers are identical - local mb = bufs:get_midi (ib) - events = mb:table() -- copy event list into lua table + -- http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:MidiBuffer + local mb = bufs:get_midi (ib) -- get the mapped buffer + events = mb:table () -- copy event list into a lua table + -- iterate over all midi events for _,e in pairs (events) do - -- e is an http://ardourman/lua-scripting/class_reference/#Evoral:MidiEvent - -- + -- e is-a http://manual.ardour.org/lua-scripting/class_reference/#Evoral:MidiEvent + --print (e:channel()) end end |