From 6995188ebd1a65a81b906fb0d326b80828f25165 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 14 Jul 2020 02:07:09 +0100 Subject: [PATCH] Fix zero-velocity note-ons on MIDI files Signed-off-by: falkTX --- source/native-plugins/midi-base.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/native-plugins/midi-base.hpp b/source/native-plugins/midi-base.hpp index 444189cce..45d1d6895 100644 --- a/source/native-plugins/midi-base.hpp +++ b/source/native-plugins/midi-base.hpp @@ -175,6 +175,10 @@ public: carla_copy(rawEvent->data, data, size); + // Fix zero-velocity note-ons + if (MIDI_IS_STATUS_NOTE_ON(data[0]) && data[2] == 0) + rawEvent->data[0] = MIDI_STATUS_NOTE_OFF; + appendSorted(rawEvent); }