Hi Guys,
I'm using a state machine to control two foot switches that send different midi messages to a guitar pedal.
All is well apart from a section where i'm trying to send two midi control change messages simultaneously, the first one sends but the second one doesn't seem too, I've tried some delays between them but still the second message doesn't seem to trigger.
Below are the two messages i'm trying to send followed by the section of code. Any help would be greatly appreciated
case B1P_B2P:
{
unsigned long releaseTime = millis(); // Record the time when the first button is released
b1.poll();
if (b1.onRelease()) {
state = B1R_B2R;
MIDI.sendControlChange(41, 127, channelNo);
MIDI.sendControlChange(49, 127, channelNo);
} else {
b2.poll();
if (b2.onRelease()) {
if ((millis() - releaseTime) < 600) {
}
state = B1P_B2R;
MIDI.sendControlChange(41, 127, channelNo);
MIDI.sendControlChange(49, 0, channelNo);
}
else if (b1.pressedFor(deltaT)) {
state = B1L_B2P;
MIDI.sendControlChange(46, 127, channelNo);
}
else if (b2.pressedFor(deltaT)) {
state = B1P_B2L;
MIDI.sendControlChange(46, 127, channelNo);
}
}
}
break;