Move access to usbMIDI to midi.ino
NuEVI.ino shouldn’t have to know about usbMIDI.
This commit is contained in:
parent
921fdb1266
commit
cc3323fd03
3 changed files with 10 additions and 4 deletions
|
@ -849,9 +849,8 @@ void loop() {
|
||||||
analogWrite(dacPin,breathCurve(map(constrain(pressureSensor,breathThrVal,breathMaxVal),breathThrVal,breathMaxVal,0,4095)));
|
analogWrite(dacPin,breathCurve(map(constrain(pressureSensor,breathThrVal,breathMaxVal),breathThrVal,breathMaxVal,0,4095)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (usbMIDI.read()) {
|
midiDiscardInput();
|
||||||
// read & ignore incoming messages
|
|
||||||
}
|
|
||||||
//do menu stuff
|
//do menu stuff
|
||||||
menu();
|
menu();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ void midiSendNoteOff(byte note);
|
||||||
void midiSendAfterTouch(byte value);
|
void midiSendAfterTouch(byte value);
|
||||||
void midiSendPitchBend(int value);
|
void midiSendPitchBend(int value);
|
||||||
|
|
||||||
|
void midiDiscardInput(void);
|
||||||
void midiReset(); // reset controllers
|
void midiReset(); // reset controllers
|
||||||
void midiPanic(); // turn all notes off
|
void midiPanic(); // turn all notes off
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,13 @@ void midiSendPitchBend(int value) {
|
||||||
dinMIDIsendPitchBend(value, midiChannel - 1);
|
dinMIDIsendPitchBend(value, midiChannel - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void midiDiscardInput()
|
||||||
|
{
|
||||||
|
while (usbMIDI.read()) {
|
||||||
|
// read & ignore incoming messages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void midiReset() { // reset controllers
|
void midiReset() { // reset controllers
|
||||||
midiSendControlChange(7, 100);
|
midiSendControlChange(7, 100);
|
||||||
midiSendControlChange(11, 127);
|
midiSendControlChange(11, 127);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue