|
|
@ -386,11 +386,8 @@ void setup() { |
|
|
|
setup_debug_message(); |
|
|
|
setup_debug_message(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#if defined(MIDI_DEVICE_USB_HOST_SERIAL) |
|
|
|
#if defined(MIDI_DEVICE_USB_HOST_SERIAL) |
|
|
|
display.clear(); |
|
|
|
|
|
|
|
display.setCursor(0, 0); |
|
|
|
|
|
|
|
display.print(F("WAIT FOR USBHOST")); |
|
|
|
|
|
|
|
display.setCursor(0, 1); |
|
|
|
display.setCursor(0, 1); |
|
|
|
display.print(F("DEVICE")); |
|
|
|
display.print(F("WAIT FOR USBHOST")); |
|
|
|
Serial.println(F("Waiting for MIDI devices on USB-Host...")); |
|
|
|
Serial.println(F("Waiting for MIDI devices on USB-Host...")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -684,8 +681,6 @@ void setup() { |
|
|
|
Serial.println(F("<setup end>")); |
|
|
|
Serial.println(F("<setup end>")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
//ep_modchorus.set_bypass(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
strlcpy(configuration.performance.name, "INIT Perf", sizeof(configuration.performance.name)); |
|
|
|
strlcpy(configuration.performance.name, "INIT Perf", sizeof(configuration.performance.name)); |
|
|
|
LCDML.OTHER_jumpToFunc(UI_func_voice_select); |
|
|
|
LCDML.OTHER_jumpToFunc(UI_func_voice_select); |
|
|
|
} |
|
|
|
} |
|
|
@ -805,7 +800,7 @@ void loop() { |
|
|
|
/******************************************************************************
|
|
|
|
/******************************************************************************
|
|
|
|
MIDI HELPER |
|
|
|
MIDI HELPER |
|
|
|
******************************************************************************/ |
|
|
|
******************************************************************************/ |
|
|
|
bool checkMidiChannel(byte inChannel, uint8_t instance_id) { |
|
|
|
bool checkMidiChannel(uint8_t inChannel, uint8_t instance_id) { |
|
|
|
// check for MIDI channel
|
|
|
|
// check for MIDI channel
|
|
|
|
if (configuration.dexed[instance_id].midi_channel == MIDI_CHANNEL_OMNI) { |
|
|
|
if (configuration.dexed[instance_id].midi_channel == MIDI_CHANNEL_OMNI) { |
|
|
|
return (true); |
|
|
|
return (true); |
|
|
@ -843,7 +838,7 @@ void init_MIDI_send_CC(void) { |
|
|
|
/******************************************************************************
|
|
|
|
/******************************************************************************
|
|
|
|
MIDI MESSAGE HANDLER |
|
|
|
MIDI MESSAGE HANDLER |
|
|
|
******************************************************************************/ |
|
|
|
******************************************************************************/ |
|
|
|
void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) { |
|
|
|
void handleNoteOn(uint8_t inChannel, uint8_t inNumber, uint8_t inVelocity) { |
|
|
|
//
|
|
|
|
//
|
|
|
|
// MIDI learn mode
|
|
|
|
// MIDI learn mode
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -988,7 +983,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) { |
|
|
|
void handleNoteOff(uint8_t inChannel, uint8_t inNumber, uint8_t inVelocity) { |
|
|
|
//
|
|
|
|
//
|
|
|
|
// MIDI learn mode
|
|
|
|
// MIDI learn mode
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -1039,7 +1034,7 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleControlChange(byte inChannel, byte inCtrl, byte inValue) { |
|
|
|
void handleControlChange(uint8_t inChannel, uint8_t inCtrl, uint8_t inValue) { |
|
|
|
inCtrl = constrain(inCtrl, 0, 127); |
|
|
|
inCtrl = constrain(inCtrl, 0, 127); |
|
|
|
inValue = constrain(inValue, 0, 127); |
|
|
|
inValue = constrain(inValue, 0, 127); |
|
|
|
|
|
|
|
|
|
|
@ -1247,7 +1242,7 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleAfterTouch(byte inChannel, byte inPressure) { |
|
|
|
void handleAfterTouch(uint8_t inChannel, uint8_t inPressure) { |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { |
|
|
|
if (checkMidiChannel(inChannel, instance_id)) { |
|
|
|
if (checkMidiChannel(inChannel, instance_id)) { |
|
|
|
MicroDexed[instance_id]->setAftertouch(inPressure); |
|
|
|
MicroDexed[instance_id]->setAftertouch(inPressure); |
|
|
@ -1256,7 +1251,7 @@ void handleAfterTouch(byte inChannel, byte inPressure) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handlePitchBend(byte inChannel, int inPitch) { |
|
|
|
void handlePitchBend(uint8_t inChannel, int inPitch) { |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { |
|
|
|
if (checkMidiChannel(inChannel, instance_id)) { |
|
|
|
if (checkMidiChannel(inChannel, instance_id)) { |
|
|
|
MicroDexed[instance_id]->setPitchbend(uint16_t(inPitch)); |
|
|
|
MicroDexed[instance_id]->setPitchbend(uint16_t(inPitch)); |
|
|
@ -1264,7 +1259,7 @@ void handlePitchBend(byte inChannel, int inPitch) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleProgramChange(byte inChannel, byte inProgram) { |
|
|
|
void handleProgramChange(uint8_t inChannel, uint8_t inProgram) { |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { |
|
|
|
if (checkMidiChannel(inChannel, instance_id)) { |
|
|
|
if (checkMidiChannel(inChannel, instance_id)) { |
|
|
|
configuration.dexed[instance_id].voice = constrain(inProgram, 0, MAX_VOICES - 1); |
|
|
|
configuration.dexed[instance_id].voice = constrain(inProgram, 0, MAX_VOICES - 1); |
|
|
@ -1326,7 +1321,7 @@ void handleSystemExclusive(byte* sysex, unsigned int len) { |
|
|
|
switch (sysex_return) { |
|
|
|
switch (sysex_return) { |
|
|
|
case -1: |
|
|
|
case -1: |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.println(F("E: SysEx end status byte not detected.")); |
|
|
|
Serial.println(F("E: SysEx end status uint8_t not detected.")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
case -2: |
|
|
|
case -2: |
|
|
@ -1591,15 +1586,15 @@ void handleSystemExclusive(byte* sysex, unsigned int len) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleTimeCodeQuarterFrame(byte data) { |
|
|
|
void handleTimeCodeQuarterFrame(uint8_t data) { |
|
|
|
; |
|
|
|
; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleAfterTouchPoly(byte inChannel, byte inNumber, byte inVelocity) { |
|
|
|
void handleAfterTouchPoly(uint8_t inChannel, uint8_t inNumber, uint8_t inVelocity) { |
|
|
|
; |
|
|
|
; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSongSelect(byte inSong) { |
|
|
|
void handleSongSelect(uint8_t inSong) { |
|
|
|
; |
|
|
|
; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|