diff options
author | Robin Gareus <robin@gareus.org> | 2019-09-09 17:10:04 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-09-09 17:10:04 +0200 |
commit | 7afb068fa68d1dba29150537c5dd8dc91d843119 (patch) | |
tree | 31a98f3678e1dc5aedefc7b6782a7ccbb9e5794c /libs/ardour/amp.cc | |
parent | cd6e074e92fffab59dca4d0b3f5a01cc6454cde4 (diff) |
When muting MIDI, silence all playing notes
All-note-off event (CC 123) needs to be accompanied
with raising the sustain-pedal (CC 64).
Diffstat (limited to 'libs/ardour/amp.cc')
-rw-r--r-- | libs/ardour/amp.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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); } } |