diff options
author | Robin Gareus <robin@gareus.org> | 2016-07-11 22:36:00 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-07-11 22:36:00 +0200 |
commit | 57df370e2abf175c3141a2e904758bfd3f95e114 (patch) | |
tree | 9da57212aa569b7dc7f3de74c4c6d3af7acf3dcb /scripts | |
parent | 4537f5fb20b2f43394ef1b47aecfd320fce0c2bb (diff) |
add a convenient lua forward mapped buffers method
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/rawmidi.lua | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/scripts/rawmidi.lua b/scripts/rawmidi.lua index 81f67f736d..9791fcbe95 100644 --- a/scripts/rawmidi.lua +++ b/scripts/rawmidi.lua @@ -46,8 +46,24 @@ function dsp_runmap (bufs, in_map, out_map, n_samples, offset) -- The following code is needed with "dsp_runmap" to work for arbitrary pin connections -- this passes though all audio/midi data unprocessed. - local audio_ins = in_map:count (): n_audio () -- number of audio input buffers - local audio_outs = out_map:count (): n_audio () -- number of audio output buffers + ARDOUR.DSP.process_map (bufs, in_map, out_map, n_samples, offset, ARDOUR.DataType ("audio")) + ARDOUR.DSP.process_map (bufs, in_map, out_map, n_samples, offset, ARDOUR.DataType ("midi")) + + -- equivalent lua code. + -- NOTE: the lua implementation below is intended for io-config [-1,-1]. + -- It only works for actually mapped channels due to in_map:count() out_map:count() + -- being identical to the i/o pin count in this case. + -- + -- Plugins that have multiple possible configurations will need to implement + -- dsp_configure() and remember the actual channel count. + -- + -- ARDOUR.DSP.process_map() does iterate over the mapping itself and works generally. + -- Still the lua code below does lend itself as elaborate example. + -- + --[[ + + local audio_ins = in_map:count (): n_audio () -- number of mapped audio input buffers + local audio_outs = out_map:count (): n_audio () -- number of mapped audio output buffers assert (audio_outs, audio_ins) -- ioconfig [-1, -1]: must match -- copy audio data if any @@ -94,4 +110,5 @@ function dsp_runmap (bufs, in_map, out_map, n_samples, offset) bufs:get_midi (ob):silence (n_samples, offset) end end + --]] end |