|
|
|
@ -77,13 +77,13 @@ MIDI_NAMESPACE::SerialMIDI<USBSerial, CustomBaudRateSettings> serialMIDI(userial |
|
|
|
|
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<USBSerial, CustomBaudRateSettings>> usbhost_midi_serial((MIDI_NAMESPACE::SerialMIDI<USBSerial, CustomBaudRateSettings> &)serialMIDI); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void handleNoteOn(byte inChannel, uint8_t inNumber, uint8_t inVelocity); |
|
|
|
|
void handleNoteOff(byte inChannel, uint8_t inNumber, uint8_t inVelocity); |
|
|
|
|
void handleControlChange(byte inChannel, uint8_t inData1, uint8_t inData2); |
|
|
|
|
void handleAfterTouch(byte inChannel, uint8_t inPressure); |
|
|
|
|
void handlePitchBend(byte inChannel, int inPitch); |
|
|
|
|
void handleProgramChange(byte inChannel, uint8_t inProgram); |
|
|
|
|
void handleAfterTouchPoly(byte inChannel, uint8_t inNumber, uint8_t inVelocity); |
|
|
|
|
void handleNoteOn(uint8_t inChannel, uint8_t inNumber, uint8_t inVelocity); |
|
|
|
|
void handleNoteOff(uint8_t inChannel, uint8_t inNumber, uint8_t inVelocity); |
|
|
|
|
void handleControlChange(uint8_t inChannel, uint8_t inData1, uint8_t inData2); |
|
|
|
|
void handleAfterTouch(uint8_t inChannel, uint8_t inPressure); |
|
|
|
|
void handlePitchBend(uint8_t inChannel, int inPitch); |
|
|
|
|
void handleProgramChange(uint8_t inChannel, uint8_t inProgram); |
|
|
|
|
void handleAfterTouchPoly(uint8_t inChannel, uint8_t inNumber, uint8_t inVelocity); |
|
|
|
|
void handleSystemExclusive(uint8_t *data, uint len); |
|
|
|
|
//void handleSystemExclusiveChunk(const uint8_t *data, uint len, bool last);
|
|
|
|
|
void handleTimeCodeQuarterFrame(uint8_t data); |
|
|
|
@ -103,8 +103,8 @@ void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value); |
|
|
|
|
#define MIDI_BY_USB_HOST "MIDI_USB_HOST" |
|
|
|
|
#define MIDI_BY_USB_HOST_SERIAL "MIDI_USB_HOST_SERIAL" |
|
|
|
|
|
|
|
|
|
void handle_generic(byte inChannel, uint8_t inData1, uint8_t inData2, const char *midi_device, midi::MidiType event) { |
|
|
|
|
//void handle_generic(byte inChannel, uint8_t inData1, uint8_t inData2, const char *midi_device, uint_8t event) {
|
|
|
|
|
void handle_generic(uint8_t inChannel, uint8_t inData1, uint8_t inData2, const char *midi_device, midi::MidiType event) { |
|
|
|
|
//void handle_generic(uint8_t inChannel, uint8_t inData1, uint8_t inData2, const char *midi_device, uint_8t event) {
|
|
|
|
|
char text[10]; |
|
|
|
|
|
|
|
|
|
switch (event) { |
|
|
|
@ -585,32 +585,32 @@ void handleRealtime_generic(const char *midi_device, midi::MidiType event) { |
|
|
|
|
*****************************************/ |
|
|
|
|
#ifdef MIDI_DEVICE_DIN |
|
|
|
|
|
|
|
|
|
void handleNoteOn_MIDI_DEVICE_DIN(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleNoteOn_MIDI_DEVICE_DIN(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::NoteOn); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleNoteOff_MIDI_DEVICE_DIN(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleNoteOff_MIDI_DEVICE_DIN(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::NoteOff); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleControlChange_MIDI_DEVICE_DIN(byte inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
|
void handleControlChange_MIDI_DEVICE_DIN(uint8_t inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_DIN, midi::ControlChange); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_DIN(byte inChannel, uint8_t inPressure) { |
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_DIN(uint8_t inChannel, uint8_t inPressure) { |
|
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_DIN, midi::AfterTouchChannel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handlePitchBend_MIDI_DEVICE_DIN(byte inChannel, int inPitch) { |
|
|
|
|
void handlePitchBend_MIDI_DEVICE_DIN(uint8_t inChannel, int inPitch) { |
|
|
|
|
inPitch += 0x2000; |
|
|
|
|
handle_generic(inChannel, (inPitch & 0x07), (inPitch >> 0x07), MIDI_BY_DIN, midi::PitchBend); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleProgramChange_MIDI_DEVICE_DIN(byte inChannel, uint8_t inProgram) { |
|
|
|
|
void handleProgramChange_MIDI_DEVICE_DIN(uint8_t inChannel, uint8_t inProgram) { |
|
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_DIN, midi::ProgramChange); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_DIN(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_DIN(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::AfterTouchPoly); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -690,32 +690,32 @@ void handleSystemReset_MIDI_DEVICE_DIN(void) { |
|
|
|
|
MIDI_DEVICE_USB_HOST |
|
|
|
|
*****************************************/ |
|
|
|
|
#ifdef MIDI_DEVICE_USB_HOST |
|
|
|
|
void handleNoteOn_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleNoteOn_MIDI_DEVICE_USB_HOST(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::NoteOn); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleNoteOff_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleNoteOff_MIDI_DEVICE_USB_HOST(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::NoteOff); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleControlChange_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
|
void handleControlChange_MIDI_DEVICE_USB_HOST(uint8_t inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_USB_HOST, midi::ControlChange); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inPressure) { |
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB_HOST(uint8_t inChannel, uint8_t inPressure) { |
|
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB_HOST, midi::AfterTouchChannel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handlePitchBend_MIDI_DEVICE_USB_HOST(byte inChannel, int inPitch) { |
|
|
|
|
void handlePitchBend_MIDI_DEVICE_USB_HOST(uint8_t inChannel, int inPitch) { |
|
|
|
|
inPitch += 0x2000; |
|
|
|
|
handle_generic(inChannel, (inPitch & 0x07), (inPitch >> 0x07), MIDI_BY_USB_HOST, midi::PitchBend); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleProgramChange_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inProgram) { |
|
|
|
|
void handleProgramChange_MIDI_DEVICE_USB_HOST(uint8_t inChannel, uint8_t inProgram) { |
|
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_USB_HOST, midi::ProgramChange); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::AfterTouchPoly); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -793,32 +793,32 @@ void handleSystemReset_MIDI_DEVICE_USB_HOST(void) { |
|
|
|
|
#endif // MIDI_DEVICE_USB_HOST
|
|
|
|
|
|
|
|
|
|
#ifdef MIDI_DEVICE_USB_HOST_SERIAL |
|
|
|
|
void handleNoteOn_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleNoteOn_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST_SERIAL, midi::NoteOn); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleNoteOff_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleNoteOff_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST_SERIAL, midi::NoteOff); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleControlChange_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
|
void handleControlChange_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_USB_HOST_SERIAL, midi::ControlChange); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inPressure) { |
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t inChannel, uint8_t inPressure) { |
|
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB_HOST_SERIAL, midi::AfterTouchChannel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handlePitchBend_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, int inPitch) { |
|
|
|
|
void handlePitchBend_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t inChannel, int inPitch) { |
|
|
|
|
inPitch += 0x2000; |
|
|
|
|
handle_generic(inChannel, (inPitch & 0x07), (inPitch >> 0x07), MIDI_BY_USB_HOST_SERIAL, midi::PitchBend); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleProgramChange_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inProgram) { |
|
|
|
|
void handleProgramChange_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t inChannel, uint8_t inProgram) { |
|
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_USB_HOST_SERIAL, midi::ProgramChange); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST_SERIAL, midi::AfterTouchPoly); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -898,32 +898,32 @@ void handleSystemReset_MIDI_DEVICE_USB_HOST_SERIAL(void) { |
|
|
|
|
MIDI_DEVICE_USB |
|
|
|
|
*****************************************/ |
|
|
|
|
#ifdef MIDI_DEVICE_USB |
|
|
|
|
void handleNoteOn_MIDI_DEVICE_USB(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleNoteOn_MIDI_DEVICE_USB(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::NoteOn); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleNoteOff_MIDI_DEVICE_USB(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleNoteOff_MIDI_DEVICE_USB(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::NoteOff); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleControlChange_MIDI_DEVICE_USB(byte inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
|
void handleControlChange_MIDI_DEVICE_USB(uint8_t inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_USB, midi::ControlChange); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB(byte inChannel, uint8_t inPressure) { |
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB(uint8_t inChannel, uint8_t inPressure) { |
|
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB, midi::AfterTouchChannel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handlePitchBend_MIDI_DEVICE_USB(byte inChannel, int inPitch) { |
|
|
|
|
void handlePitchBend_MIDI_DEVICE_USB(uint8_t inChannel, int inPitch) { |
|
|
|
|
inPitch += 0x2000; |
|
|
|
|
handle_generic(inChannel, (inPitch & 0x07), (inPitch >> 0x07), MIDI_BY_USB, midi::PitchBend); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleProgramChange_MIDI_DEVICE_USB(byte inChannel, uint8_t inProgram) { |
|
|
|
|
void handleProgramChange_MIDI_DEVICE_USB(uint8_t inChannel, uint8_t inProgram) { |
|
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_USB, midi::ProgramChange); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB(uint8_t inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::AfterTouchPoly); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|