|
|
@ -24,6 +24,8 @@ |
|
|
|
#ifndef MIDI_DEVICES_H |
|
|
|
#ifndef MIDI_DEVICES_H |
|
|
|
#define MIDI_DEVICES_H |
|
|
|
#define MIDI_DEVICES_H |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <MIDI.h> |
|
|
|
|
|
|
|
#include <midi_Message.h> |
|
|
|
#include "config.h" |
|
|
|
#include "config.h" |
|
|
|
|
|
|
|
|
|
|
|
extern config_t configuration; |
|
|
|
extern config_t configuration; |
|
|
@ -36,7 +38,7 @@ extern config_t configuration; |
|
|
|
struct MicroDexedSettings : public midi::DefaultSettings { |
|
|
|
struct MicroDexedSettings : public midi::DefaultSettings { |
|
|
|
static const bool UseRunningStatus = false; |
|
|
|
static const bool UseRunningStatus = false; |
|
|
|
static const bool HandleNullVelocityNoteOnAsNoteOff = true; |
|
|
|
static const bool HandleNullVelocityNoteOnAsNoteOff = true; |
|
|
|
static const bool Use1ByteParsing = true; |
|
|
|
static const bool Use1uint8_tParsing = true; |
|
|
|
static const unsigned SysExMaxSize = 4104; |
|
|
|
static const unsigned SysExMaxSize = 4104; |
|
|
|
static const bool UseSenderActiveSensing = false; |
|
|
|
static const bool UseSenderActiveSensing = false; |
|
|
|
static const bool UseReceiverActiveSensing = false; |
|
|
|
static const bool UseReceiverActiveSensing = false; |
|
|
@ -72,17 +74,17 @@ MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings> serialMI |
|
|
|
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings>> usbhost_midi_serial((MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings> &)serialMIDI); |
|
|
|
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings>> usbhost_midi_serial((MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings> &)serialMIDI); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity); |
|
|
|
void handleNoteOn(byte inChannel, uint8_t inNumber, uint8_t inVelocity); |
|
|
|
void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity); |
|
|
|
void handleNoteOff(byte inChannel, uint8_t inNumber, uint8_t inVelocity); |
|
|
|
void handleControlChange(byte inChannel, byte inData1, byte inData2); |
|
|
|
void handleControlChange(byte inChannel, uint8_t inData1, uint8_t inData2); |
|
|
|
void handleAfterTouch(byte inChannel, byte inPressure); |
|
|
|
void handleAfterTouch(byte inChannel, uint8_t inPressure); |
|
|
|
void handlePitchBend(byte inChannel, int inPitch); |
|
|
|
void handlePitchBend(byte inChannel, int inPitch); |
|
|
|
void handleProgramChange(byte inChannel, byte inProgram); |
|
|
|
void handleProgramChange(byte inChannel, uint8_t inProgram); |
|
|
|
void handleAfterTouchPoly(byte inChannel, byte inNumber, byte inVelocity); |
|
|
|
void handleAfterTouchPoly(byte inChannel, uint8_t inNumber, uint8_t inVelocity); |
|
|
|
void handleSystemExclusive(byte *data, uint len); |
|
|
|
void handleSystemExclusive(uint8_t *data, uint len); |
|
|
|
//void handleSystemExclusiveChunk(const byte *data, uint len, bool last);
|
|
|
|
//void handleSystemExclusiveChunk(const uint8_t *data, uint len, bool last);
|
|
|
|
void handleTimeCodeQuarterFrame(byte data); |
|
|
|
void handleTimeCodeQuarterFrame(uint8_t data); |
|
|
|
void handleSongSelect(byte inSong); |
|
|
|
void handleSongSelect(uint8_t inSong); |
|
|
|
void handleTuneRequest(void); |
|
|
|
void handleTuneRequest(void); |
|
|
|
void handleClock(void); |
|
|
|
void handleClock(void); |
|
|
|
void handleStart(void); |
|
|
|
void handleStart(void); |
|
|
@ -90,7 +92,7 @@ void handleContinue(void); |
|
|
|
void handleStop(void); |
|
|
|
void handleStop(void); |
|
|
|
void handleActiveSensing(void); |
|
|
|
void handleActiveSensing(void); |
|
|
|
void handleSystemReset(void); |
|
|
|
void handleSystemReset(void); |
|
|
|
//void handleRealTimeSystem(void);
|
|
|
|
//void handleRealTimeSystem(void);
|
|
|
|
void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value); |
|
|
|
void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value); |
|
|
|
|
|
|
|
|
|
|
|
#define MIDI_BY_DIN "MIDI_DIN" |
|
|
|
#define MIDI_BY_DIN "MIDI_DIN" |
|
|
@ -98,7 +100,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 "MIDI_USB_HOST" |
|
|
|
#define MIDI_BY_USB_HOST_SERIAL "MIDI_USB_HOST_SERIAL" |
|
|
|
#define MIDI_BY_USB_HOST_SERIAL "MIDI_USB_HOST_SERIAL" |
|
|
|
|
|
|
|
|
|
|
|
void handle_generic(byte inChannel, byte inData1, byte inData2, const char *midi_device, midi::MidiType event) { |
|
|
|
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) {
|
|
|
|
char text[10]; |
|
|
|
char text[10]; |
|
|
|
|
|
|
|
|
|
|
|
switch (event) { |
|
|
|
switch (event) { |
|
|
@ -277,7 +280,7 @@ void handle_generic(byte inChannel, byte inData1, byte inData2, const char *midi |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSystemExclusive_generic(byte *data, uint len, const char *midi_device) { |
|
|
|
void handleSystemExclusive_generic(uint8_t *data, uint len, const char *midi_device) { |
|
|
|
handleSystemExclusive(data, len); |
|
|
|
handleSystemExclusive(data, len); |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.printf_P(PSTR("[%s] SysEx"), midi_device); |
|
|
|
Serial.printf_P(PSTR("[%s] SysEx"), midi_device); |
|
|
@ -327,7 +330,7 @@ void handleSystemExclusive_generic(byte *data, uint len, const char *midi_device |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSystemCommon_generic(byte inData1, const char *midi_device, midi::MidiType event) { |
|
|
|
void handleSystemCommon_generic(uint8_t inData1, const char *midi_device, midi::MidiType event) { |
|
|
|
char text[10]; |
|
|
|
char text[10]; |
|
|
|
|
|
|
|
|
|
|
|
switch (event) { |
|
|
|
switch (event) { |
|
|
@ -521,9 +524,9 @@ void handleRealtime_generic(const char *midi_device, midi::MidiType event) { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
///* void handleSystemExclusiveChunk_MIDI_DEVICE_DIN(byte *data, uint len, bool last)
|
|
|
|
///* void handleSystemExclusiveChunk_MIDI_DEVICE_DIN(uint8_t *data, uint len, bool last)
|
|
|
|
|
|
|
|
|
|
|
|
// void handlRealTimeSystem_generic(byte inRealTime, byte midi_device) {
|
|
|
|
// void handlRealTimeSystem_generic(uint8_t inRealTime, uint8_t midi_device) {
|
|
|
|
// handleRealTimeSystem();
|
|
|
|
// handleRealTimeSystem();
|
|
|
|
// #ifdef DEBUG
|
|
|
|
// #ifdef DEBUG
|
|
|
|
// switch(midi_device) {
|
|
|
|
// switch(midi_device) {
|
|
|
@ -579,19 +582,19 @@ void handleRealtime_generic(const char *midi_device, midi::MidiType event) { |
|
|
|
*****************************************/ |
|
|
|
*****************************************/ |
|
|
|
#ifdef MIDI_DEVICE_DIN |
|
|
|
#ifdef MIDI_DEVICE_DIN |
|
|
|
|
|
|
|
|
|
|
|
void handleNoteOn_MIDI_DEVICE_DIN(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleNoteOn_MIDI_DEVICE_DIN(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::NoteOn); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::NoteOn); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleNoteOff_MIDI_DEVICE_DIN(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleNoteOff_MIDI_DEVICE_DIN(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::NoteOff); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::NoteOff); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleControlChange_MIDI_DEVICE_DIN(byte inChannel, byte inData1, byte inData2) { |
|
|
|
void handleControlChange_MIDI_DEVICE_DIN(byte inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_DIN, midi::ControlChange); |
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_DIN, midi::ControlChange); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_DIN(byte inChannel, byte inPressure) { |
|
|
|
void handleAfterTouch_MIDI_DEVICE_DIN(byte inChannel, uint8_t inPressure) { |
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_DIN, midi::AfterTouchChannel); |
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_DIN, midi::AfterTouchChannel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -599,19 +602,19 @@ void handlePitchBend_MIDI_DEVICE_DIN(byte inChannel, int inPitch) { |
|
|
|
handle_generic(inChannel, inPitch, '\0', MIDI_BY_DIN, midi::PitchBend); |
|
|
|
handle_generic(inChannel, inPitch, '\0', MIDI_BY_DIN, midi::PitchBend); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleProgramChange_MIDI_DEVICE_DIN(byte inChannel, byte inProgram) { |
|
|
|
void handleProgramChange_MIDI_DEVICE_DIN(byte inChannel, uint8_t inProgram) { |
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_DIN, midi::ProgramChange); |
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_DIN, midi::ProgramChange); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_DIN(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_DIN(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::AfterTouchPoly); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_DIN, midi::AfterTouchPoly); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSystemExclusive_MIDI_DEVICE_DIN(byte *data, uint len) { |
|
|
|
void handleSystemExclusive_MIDI_DEVICE_DIN(uint8_t *data, uint len) { |
|
|
|
handleSystemExclusive_generic(data, len, MIDI_BY_DIN); |
|
|
|
handleSystemExclusive_generic(data, len, MIDI_BY_DIN); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* void handleSystemExclusiveChunk_MIDI_DEVICE_DIN(byte *data, uint len, bool last)
|
|
|
|
/* void handleSystemExclusiveChunk_MIDI_DEVICE_DIN(uint8_t *data, uint len, bool last)
|
|
|
|
{ |
|
|
|
{ |
|
|
|
handleSystemExclusiveChunk(data, len, last); |
|
|
|
handleSystemExclusiveChunk(data, len, last); |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
@ -637,11 +640,11 @@ void handleSystemExclusive_MIDI_DEVICE_DIN(byte *data, uint len) { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} */ |
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
void handleTimeCodeQuarterFrame_MIDI_DEVICE_DIN(byte data) { |
|
|
|
void handleTimeCodeQuarterFrame_MIDI_DEVICE_DIN(uint8_t data) { |
|
|
|
handleSystemCommon_generic(data, MIDI_BY_DIN, midi::TimeCodeQuarterFrame); |
|
|
|
handleSystemCommon_generic(data, MIDI_BY_DIN, midi::TimeCodeQuarterFrame); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSongSelect_MIDI_DEVICE_DIN(byte inSong) { |
|
|
|
void handleSongSelect_MIDI_DEVICE_DIN(uint8_t inSong) { |
|
|
|
handleSystemCommon_generic(inSong, MIDI_BY_DIN, midi::SongSelect); |
|
|
|
handleSystemCommon_generic(inSong, MIDI_BY_DIN, midi::SongSelect); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -673,7 +676,7 @@ void handleSystemReset_MIDI_DEVICE_DIN(void) { |
|
|
|
handleRealtime_generic(MIDI_BY_DIN, midi::SystemReset); |
|
|
|
handleRealtime_generic(MIDI_BY_DIN, midi::SystemReset); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* void handlRealTimeSysteme_MIDI_DEVICE_DIN(byte inRealTime)
|
|
|
|
/* void handlRealTimeSysteme_MIDI_DEVICE_DIN(uint8_t inRealTime)
|
|
|
|
{ |
|
|
|
{ |
|
|
|
handleRealTimeSystem_generic(MIDI_DIN); |
|
|
|
handleRealTimeSystem_generic(MIDI_DIN); |
|
|
|
} */ |
|
|
|
} */ |
|
|
@ -683,19 +686,19 @@ void handleSystemReset_MIDI_DEVICE_DIN(void) { |
|
|
|
MIDI_DEVICE_USB_HOST |
|
|
|
MIDI_DEVICE_USB_HOST |
|
|
|
*****************************************/ |
|
|
|
*****************************************/ |
|
|
|
#ifdef MIDI_DEVICE_USB_HOST |
|
|
|
#ifdef MIDI_DEVICE_USB_HOST |
|
|
|
void handleNoteOn_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleNoteOn_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::NoteOn); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::NoteOn); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleNoteOff_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleNoteOff_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::NoteOff); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::NoteOff); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleControlChange_MIDI_DEVICE_USB_HOST(byte inChannel, byte inData1, byte inData2) { |
|
|
|
void handleControlChange_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_USB_HOST, midi::ControlChange); |
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_USB_HOST, midi::ControlChange); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB_HOST(byte inChannel, byte inPressure) { |
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inPressure) { |
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB_HOST, midi::AfterTouchChannel); |
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB_HOST, midi::AfterTouchChannel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -703,19 +706,19 @@ void handlePitchBend_MIDI_DEVICE_USB_HOST(byte inChannel, int inPitch) { |
|
|
|
handle_generic(inChannel, inPitch, '\0', MIDI_BY_USB_HOST, midi::PitchBend); |
|
|
|
handle_generic(inChannel, inPitch, '\0', MIDI_BY_USB_HOST, midi::PitchBend); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleProgramChange_MIDI_DEVICE_USB_HOST(byte inChannel, byte inProgram) { |
|
|
|
void handleProgramChange_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inProgram) { |
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_USB_HOST, midi::ProgramChange); |
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_USB_HOST, midi::ProgramChange); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::AfterTouchPoly); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST, midi::AfterTouchPoly); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSystemExclusive_MIDI_DEVICE_USB_HOST(byte *data, uint len) { |
|
|
|
void handleSystemExclusive_MIDI_DEVICE_USB_HOST(uint8_t *data, uint len) { |
|
|
|
handleSystemExclusive_generic(data, len, MIDI_BY_USB_HOST); |
|
|
|
handleSystemExclusive_generic(data, len, MIDI_BY_USB_HOST); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* void handleSystemExclusiveChunk_MIDI_DEVICE_USB_HOST(byte *data, uint len, bool last)
|
|
|
|
/* void handleSystemExclusiveChunk_MIDI_DEVICE_USB_HOST(uint8_t *data, uint len, bool last)
|
|
|
|
{ |
|
|
|
{ |
|
|
|
handleSystemExclusiveChunk(data, len, last); |
|
|
|
handleSystemExclusiveChunk(data, len, last); |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
@ -741,11 +744,11 @@ void handleSystemExclusive_MIDI_DEVICE_USB_HOST(byte *data, uint len) { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} */ |
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
void handleTimeCodeQuarterFrame_MIDI_DEVICE_USB_HOST(midi::DataByte data) { |
|
|
|
void handleTimeCodeQuarterFrame_MIDI_DEVICE_USB_HOST(uint8_t data) { |
|
|
|
handleSystemCommon_generic(data, MIDI_BY_USB_HOST, midi::TimeCodeQuarterFrame); |
|
|
|
handleSystemCommon_generic(data, MIDI_BY_USB_HOST, midi::TimeCodeQuarterFrame); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSongSelect_MIDI_DEVICE_USB_HOST(byte inSong) { |
|
|
|
void handleSongSelect_MIDI_DEVICE_USB_HOST(uint8_t inSong) { |
|
|
|
handleSystemCommon_generic(inSong, MIDI_BY_USB_HOST, midi::SongSelect); |
|
|
|
handleSystemCommon_generic(inSong, MIDI_BY_USB_HOST, midi::SongSelect); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -785,19 +788,19 @@ void handleSystemReset_MIDI_DEVICE_USB_HOST(void) { |
|
|
|
#endif // MIDI_DEVICE_USB_HOST
|
|
|
|
#endif // MIDI_DEVICE_USB_HOST
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef MIDI_DEVICE_USB_HOST_SERIAL |
|
|
|
#ifdef MIDI_DEVICE_USB_HOST_SERIAL |
|
|
|
void handleNoteOn_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleNoteOn_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST_SERIAL, midi::NoteOn); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST_SERIAL, midi::NoteOn); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleNoteOff_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleNoteOff_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST_SERIAL, midi::NoteOff); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST_SERIAL, midi::NoteOff); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleControlChange_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, byte inData1, byte inData2) { |
|
|
|
void handleControlChange_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_USB_HOST_SERIAL, midi::ControlChange); |
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_USB_HOST_SERIAL, midi::ControlChange); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, byte inPressure) { |
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inPressure) { |
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB_HOST_SERIAL, midi::AfterTouchChannel); |
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB_HOST_SERIAL, midi::AfterTouchChannel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -805,19 +808,19 @@ void handlePitchBend_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, int inPitch) { |
|
|
|
handle_generic(inChannel, inPitch, '\0', MIDI_BY_USB_HOST_SERIAL, midi::PitchBend); |
|
|
|
handle_generic(inChannel, inPitch, '\0', MIDI_BY_USB_HOST_SERIAL, midi::PitchBend); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleProgramChange_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, byte inProgram) { |
|
|
|
void handleProgramChange_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inProgram) { |
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_USB_HOST_SERIAL, midi::ProgramChange); |
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_USB_HOST_SERIAL, midi::ProgramChange); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST_SERIAL(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST_SERIAL, midi::AfterTouchPoly); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB_HOST_SERIAL, midi::AfterTouchPoly); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSystemExclusive_MIDI_DEVICE_USB_HOST_SERIAL(byte *data, uint len) { |
|
|
|
void handleSystemExclusive_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t *data, uint len) { |
|
|
|
handleSystemExclusive_generic(data, len, MIDI_BY_USB_HOST_SERIAL); |
|
|
|
handleSystemExclusive_generic(data, len, MIDI_BY_USB_HOST_SERIAL); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* void handleSystemExclusiveChunk_MIDI_DEVICE_USB_HOST_SERIAL(byte *data, uint len, bool last)
|
|
|
|
/* void handleSystemExclusiveChunk_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t *data, uint len, bool last)
|
|
|
|
{ |
|
|
|
{ |
|
|
|
handleSystemExclusiveChunk(data, len, last); |
|
|
|
handleSystemExclusiveChunk(data, len, last); |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
@ -843,11 +846,11 @@ void handleSystemExclusive_MIDI_DEVICE_USB_HOST_SERIAL(byte *data, uint len) { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} */ |
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
void handleTimeCodeQuarterFrame_MIDI_DEVICE_USB_HOST_SERIAL(midi::DataByte data) { |
|
|
|
void handleTimeCodeQuarterFrame_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t data) { |
|
|
|
handleSystemCommon_generic(data, MIDI_BY_USB_HOST_SERIAL, midi::TimeCodeQuarterFrame); |
|
|
|
handleSystemCommon_generic(data, MIDI_BY_USB_HOST_SERIAL, midi::TimeCodeQuarterFrame); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSongSelect_MIDI_DEVICE_USB_HOST_SERIAL(byte inSong) { |
|
|
|
void handleSongSelect_MIDI_DEVICE_USB_HOST_SERIAL(uint8_t inSong) { |
|
|
|
handleSystemCommon_generic(inSong, MIDI_BY_USB_HOST_SERIAL, midi::SongSelect); |
|
|
|
handleSystemCommon_generic(inSong, MIDI_BY_USB_HOST_SERIAL, midi::SongSelect); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -889,19 +892,19 @@ void handleSystemReset_MIDI_DEVICE_USB_HOST_SERIAL(void) { |
|
|
|
MIDI_DEVICE_USB |
|
|
|
MIDI_DEVICE_USB |
|
|
|
*****************************************/ |
|
|
|
*****************************************/ |
|
|
|
#ifdef MIDI_DEVICE_USB |
|
|
|
#ifdef MIDI_DEVICE_USB |
|
|
|
void handleNoteOn_MIDI_DEVICE_USB(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleNoteOn_MIDI_DEVICE_USB(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::NoteOn); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::NoteOn); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleNoteOff_MIDI_DEVICE_USB(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleNoteOff_MIDI_DEVICE_USB(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::NoteOff); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::NoteOff); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleControlChange_MIDI_DEVICE_USB(byte inChannel, byte inData1, byte inData2) { |
|
|
|
void handleControlChange_MIDI_DEVICE_USB(byte inChannel, uint8_t inData1, uint8_t inData2) { |
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_USB, midi::ControlChange); |
|
|
|
handle_generic(inChannel, inData1, inData2, MIDI_BY_USB, midi::ControlChange); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB(byte inChannel, byte inPressure) { |
|
|
|
void handleAfterTouch_MIDI_DEVICE_USB(byte inChannel, uint8_t inPressure) { |
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB, midi::AfterTouchChannel); |
|
|
|
handle_generic(inChannel, inPressure, '\0', MIDI_BY_USB, midi::AfterTouchChannel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -909,19 +912,19 @@ void handlePitchBend_MIDI_DEVICE_USB(byte inChannel, int inPitch) { |
|
|
|
handle_generic(inChannel, inPitch, '\0', MIDI_BY_USB, midi::PitchBend); |
|
|
|
handle_generic(inChannel, inPitch, '\0', MIDI_BY_USB, midi::PitchBend); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleProgramChange_MIDI_DEVICE_USB(byte inChannel, byte inProgram) { |
|
|
|
void handleProgramChange_MIDI_DEVICE_USB(byte inChannel, uint8_t inProgram) { |
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_USB, midi::ProgramChange); |
|
|
|
handle_generic(inChannel, inProgram, '\0', MIDI_BY_USB, midi::ProgramChange); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB(byte inChannel, byte inNoteNumber, byte inVelocity) { |
|
|
|
void handleAfterTouchPoly_MIDI_DEVICE_USB(byte inChannel, uint8_t inNoteNumber, uint8_t inVelocity) { |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::AfterTouchPoly); |
|
|
|
handle_generic(inChannel, inNoteNumber, inVelocity, MIDI_BY_USB, midi::AfterTouchPoly); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSystemExclusive_MIDI_DEVICE_USB(byte *data, uint len) { |
|
|
|
void handleSystemExclusive_MIDI_DEVICE_USB(uint8_t *data, uint len) { |
|
|
|
handleSystemExclusive_generic(data, len, MIDI_BY_USB); |
|
|
|
handleSystemExclusive_generic(data, len, MIDI_BY_USB); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* FLASHMEM void handleSystemExclusiveChunk_MIDI_DEVICE_USB(byte *data, uint len, bool last)
|
|
|
|
/* FLASHMEM void handleSystemExclusiveChunk_MIDI_DEVICE_USB(uint8_t *data, uint len, bool last)
|
|
|
|
{ |
|
|
|
{ |
|
|
|
handleSystemExclusiveChunk(data, len, last); |
|
|
|
handleSystemExclusiveChunk(data, len, last); |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
@ -947,11 +950,11 @@ void handleSystemExclusive_MIDI_DEVICE_USB(byte *data, uint len) { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} */ |
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
void handleTimeCodeQuarterFrame_MIDI_DEVICE_USB(midi::DataByte data) { |
|
|
|
void handleTimeCodeQuarterFrame_MIDI_DEVICE_USB(uint8_t data) { |
|
|
|
handleSystemCommon_generic(data, MIDI_BY_USB, midi::TimeCodeQuarterFrame); |
|
|
|
handleSystemCommon_generic(data, MIDI_BY_USB, midi::TimeCodeQuarterFrame); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleSongSelect_MIDI_DEVICE_USB(byte inSong) { |
|
|
|
void handleSongSelect_MIDI_DEVICE_USB(uint8_t inSong) { |
|
|
|
handleSystemCommon_generic(inSong, MIDI_BY_USB, midi::SongSelect); |
|
|
|
handleSystemCommon_generic(inSong, MIDI_BY_USB, midi::SongSelect); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -983,7 +986,7 @@ void handleSystemReset_MIDI_DEVICE_USB(void) { |
|
|
|
handleRealtime_generic(MIDI_BY_USB, midi::SystemReset); |
|
|
|
handleRealtime_generic(MIDI_BY_USB, midi::SystemReset); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* FLASHMEM void handleRealTimeSystem_MIDI_DEVICE_USB(byte inRealTime)
|
|
|
|
/* FLASHMEM void handleRealTimeSystem_MIDI_DEVICE_USB(uint8_t inRealTime)
|
|
|
|
{ |
|
|
|
{ |
|
|
|
handleRealTimeSystem_generic(inRealTime, USB_MIDI); |
|
|
|
handleRealTimeSystem_generic(inRealTime, USB_MIDI); |
|
|
|
} */ |
|
|
|
} */ |
|
|
@ -1174,8 +1177,8 @@ FLASHMEM void send_sysex_voice(uint8_t midi_channel, uint8_t *data) { |
|
|
|
vd[0] = 0x43; // ID=Yamaha
|
|
|
|
vd[0] = 0x43; // ID=Yamaha
|
|
|
|
vd[1] = midi_channel; // Sub-status and MIDI channel
|
|
|
|
vd[1] = midi_channel; // Sub-status and MIDI channel
|
|
|
|
vd[2] = 0x00; // Format number (0=1 voice)
|
|
|
|
vd[2] = 0x00; // Format number (0=1 voice)
|
|
|
|
vd[3] = 0x01; // Byte count MSB
|
|
|
|
vd[3] = 0x01; // uint8_t count MSB
|
|
|
|
vd[4] = 0x1B; // Byte count LSB
|
|
|
|
vd[4] = 0x1B; // uint8_t count LSB
|
|
|
|
for (uint8_t n = 0; n < 155; n++) { |
|
|
|
for (uint8_t n = 0; n < 155; n++) { |
|
|
|
checksum -= data[n]; |
|
|
|
checksum -= data[n]; |
|
|
|
vd[5 + n] = data[n]; |
|
|
|
vd[5 + n] = data[n]; |
|
|
|