From 728196c9d55100b63b74b2f118bd80d451636a6c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 24 Mar 2018 20:26:29 +0100 Subject: eg-midigate: Respond to "all notes off" MIDI message --- plugins/eg-midigate.lv2/midigate.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'plugins/eg-midigate.lv2/midigate.c') diff --git a/plugins/eg-midigate.lv2/midigate.c b/plugins/eg-midigate.lv2/midigate.c index 3070660..a967384 100644 --- a/plugins/eg-midigate.lv2/midigate.c +++ b/plugins/eg-midigate.lv2/midigate.c @@ -165,7 +165,14 @@ run(LV2_Handle instance, uint32_t sample_count) ++self->n_active_notes; break; case LV2_MIDI_MSG_NOTE_OFF: - --self->n_active_notes; + if (self->n_active_notes > 0) { + --self->n_active_notes; + } + break; + case LV2_MIDI_MSG_CONTROLLER: + if (msg[1] == LV2_MIDI_CTL_ALL_NOTES_OFF) { + self->n_active_notes = 0; + } break; case LV2_MIDI_MSG_PGM_CHANGE: if (msg[1] == 0 || msg[1] == 1) { -- cgit v1.2.1