diff --git a/src/synth/MidiController.cpp b/src/synth/MidiController.cpp index fcc5481..c7c2afd 100644 --- a/src/synth/MidiController.cpp +++ b/src/synth/MidiController.cpp @@ -88,6 +88,18 @@ void MidiController::handleMessage(const std::vector& msg) { if(status == 0xFE) return; // "Active Sensing" -> 300ms heartbeat. could be useful to sense if this is missing for device failure detection if(status == 0xF8) return; // "Timing Clock" -> 24 pulses per quarter note, for steady rhythm. not useful for this instrument + if(status == 0xB0) { // channel mode change + if((data1 & 0xF0) == 0x70) { // all notes off for this channel + for(uint8_t i = 0; i < UINT8_MAX; i++) { + noteOff(i); + } + return; + } + // TODO: msg[0] contains the channel to turn all notes off for + // since the current implementation is channel agnostic, we just turn all notes off + // eventually we might have noteOff(channelLookup(msg[0]), i); + } + // sustain pedal message event if(status == 0xB0 && data1 == 64) { handleSustain(data2 >= 64);