From 7afb068fa68d1dba29150537c5dd8dc91d843119 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 9 Sep 2019 17:10:04 +0200 Subject: [PATCH] When muting MIDI, silence all playing notes All-note-off event (CC 123) needs to be accompanied with raising the sustain-pedal (CC 64). --- libs/ardour/amp.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc index b27805c883..80cb5b6fcb 100644 --- a/libs/ardour/amp.cc +++ b/libs/ardour/amp.cc @@ -233,7 +233,9 @@ Amp::apply_gain (BufferSet& bufs, samplecnt_t sample_rate, samplecnt_t nframes, /* queue MIDI all-note-off when going silent */ if (initial > GAIN_COEFF_SMALL && rv <= GAIN_COEFF_SMALL) { for (uint8_t channel = 0; channel <= 0xF; channel++) { - uint8_t ev[3] = { ((uint8_t) (MIDI_CMD_CONTROL | channel)), ((uint8_t) MIDI_CTL_ALL_NOTES_OFF), 0 }; + uint8_t ev[3] = { ((uint8_t) (MIDI_CMD_CONTROL | channel)), ((uint8_t) MIDI_CTL_SUSTAIN), 0 }; + mb.push_back (nframes - 1, 3, ev); + ev[1] = MIDI_CTL_ALL_NOTES_OFF; mb.push_back (nframes - 1, 3, ev); } }