Add support for Lua DSP scripts with multiple MIDI outputs
This commit is contained in:
parent
d1302ae934
commit
8702ff2189
@ -725,12 +725,15 @@ LuaProc::connect_and_run (BufferSet& bufs,
|
|||||||
|
|
||||||
// copy back midi events
|
// copy back midi events
|
||||||
if (_has_midi_output && lua_midi_sink_tbl.isTable ()) {
|
if (_has_midi_output && lua_midi_sink_tbl.isTable ()) {
|
||||||
bool valid;
|
uint32_t count = 0;
|
||||||
const uint32_t idx = out.get(DataType::MIDI, 0, &valid);
|
uint32_t idx;
|
||||||
if (valid && bufs.count().n_midi() > idx) {
|
for (luabridge::Iterator i (lua_midi_sink_tbl); !i.isNil (); ++i) {
|
||||||
|
bool iter_is_valid;
|
||||||
|
idx = out.get(DataType::MIDI, count, &iter_is_valid);
|
||||||
|
count++;
|
||||||
|
if (iter_is_valid && bufs.count().n_midi() > idx) {
|
||||||
MidiBuffer& mbuf = bufs.get_midi(idx);
|
MidiBuffer& mbuf = bufs.get_midi(idx);
|
||||||
mbuf.silence(0, 0);
|
mbuf.silence(0, 0);
|
||||||
for (luabridge::Iterator i (lua_midi_sink_tbl); !i.isNil (); ++i) {
|
|
||||||
if (!i.key ().isNumber ()) { continue; }
|
if (!i.key ().isNumber ()) { continue; }
|
||||||
if (!i.value ()["time"].isNumber ()) { continue; }
|
if (!i.value ()["time"].isNumber ()) { continue; }
|
||||||
if (!i.value ()["data"].isTable ()) { continue; }
|
if (!i.value ()["data"].isTable ()) { continue; }
|
||||||
|
Loading…
Reference in New Issue
Block a user