13
0

VST2: amend prev commit, ignore SysEx and invalid MIDI events

This commit is contained in:
Robin Gareus 2024-06-30 23:07:29 +02:00
parent e1ef129ab0
commit 630587ee3f
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -302,11 +302,12 @@ intptr_t Session::vst_callback (
VstEvents* v = (VstEvents*)ptr;
for (int n = 0 ; n < v->numEvents; ++n) {
VstMidiEvent *vme = (VstMidiEvent*) (v->events[n]->dump);
if (vme->type == kVstMidiType) {
int size = Evoral::midi_event_size((uint8_t)vme->midiData[0]);
if (vme->type == kVstMidiType && size > 0) {
plug->midi_buffer()->push_back(
vme->deltaSamples,
Evoral::MIDI_EVENT,
Evoral::midi_event_size((uint8_t)vme->midiData[0]),
size,
(uint8_t*)vme->midiData
);
}