MIDI in now works (code)

This commit is contained in:
2023-10-27 11:35:59 +03:00
parent 371d256c08
commit 66218a307c
3 changed files with 16 additions and 4 deletions

View File

@ -212,6 +212,9 @@ void setup() {
void loop() {
checkInputs();
if (masterClockMode == 2) {
receiveMIDI();
}
}
void sendMIDIClock() {
@ -227,10 +230,10 @@ void receiveMIDI() {
if(Serial.available() > 0) {
if (Serial.read() == 0xF8) { //Clock
MIDIClockRecived = true;
} else if (Serial.read() == 0xFA || Serial.read() == 0xFB) { //start and continue
//} else if (Serial.read() == 0xFA || Serial.read() == 0xFB) { //start and continue
isPlaying = true;
} else if (Serial.read() == 0xFC) { //stop
isPlaying = false;
//} else if (Serial.read() == 0xFC) { //stop
// isPlaying = false;
}
}
}

View File

@ -317,7 +317,14 @@ void checkInputs() {
if (masterClockMode == 0) {
calculateBPMTiming();
resetClocks();
isPlaying = !isPlaying;
//isPlaying = !isPlaying;
if (!isPlaying) {
isPlaying = true;
sendMIDIStart();
} else {
isPlaying = false;
sendMIDIStop();
}
}
playBtnPushed = true;
updateScreen(); //to wake up the screen if turned off

View File

@ -25,6 +25,8 @@ void updateScreen() {
lastMenuItem = 3;
} else if (masterClockMode == 1) {
lastMenuItem = 1;
} else if (masterClockMode == 2) {
lastMenuItem = 1;
}
for (byte i = 1; i <= lastMenuItem; i++) {