MIDI in now works (code)
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user