Update MIDI.hpp

- added if statement asking for "useRunningStatus", as it caused a bug 
with a certain midi device, causing the arduino to resolve the same midi 
data multiple times. I think it was forgotten here, as the comment also 
suggests that this section is only for "if enabled..."
This commit is contained in:
Lukas Schwabe 2019-11-25 03:51:33 +01:00
parent 2ffbdef8da
commit de8e227af0
1 changed files with 24 additions and 15 deletions

View File

@ -911,24 +911,33 @@ bool MidiInterface<SerialPort, Settings>::parse()
mMessage.valid = true;
// Activate running status (if enabled for the received type)
switch (mMessage.type)
{
case NoteOff:
case NoteOn:
case AfterTouchPoly:
case ControlChange:
case ProgramChange:
case AfterTouchChannel:
case PitchBend:
// Running status enabled: store it from received message
mRunningStatus_RX = mPendingMessage[0];
break;
if (Settings::UseRunningStatus) {
default:
switch (mMessage.type)
{
case NoteOff:
case NoteOn:
case AfterTouchPoly:
case ControlChange:
case ProgramChange:
case AfterTouchChannel:
case PitchBend:
// Running status enabled: store it from received message
mRunningStatus_RX = mPendingMessage[0];
break;
default:
// No running status
mRunningStatus_RX = InvalidType;
break;
mRunningStatus_RX = InvalidType;
break;
}
}
else {
mRunningStatus_RX = InvalidType;
}
return true;
}
else