13
0

VST3: clear in-place MIDI buffers #8789

This commit is contained in:
Robin Gareus 2021-08-23 07:09:16 +02:00
parent 73326ade90
commit 1e84f217ac
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -731,6 +731,16 @@ VST3Plugin::connect_and_run (BufferSet& bufs,
/* handle outgoing MIDI events */
if (_plug->n_midi_outputs () > 0 && bufs.count ().n_midi () > 0) {
/* clear valid in-place MIDI buffers (forward MIDI otherwise) */
in_index = 0;
for (int32_t i = 0; i < (int32_t)_plug->n_midi_inputs (); ++i) {
bool valid = false;
uint32_t index = in_map.get (DataType::MIDI, in_index++, &valid);
if (valid && bufs.count ().n_midi () > index) {
bufs.get_midi (index).clear ();
}
}
_plug->vst3_to_midi_buffers (bufs, out_map);
}