fix midi bug that caused the synth to continue to play notes after an interface stops output
This commit is contained in:
@@ -88,6 +88,18 @@ void MidiController::handleMessage(const std::vector<unsigned char>& 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);
|
||||
|
||||
Reference in New Issue
Block a user