Example showing how to send any MIDI message.
Note Off         Channel: 6 Data 1: 0x3c  Data 2: 0x7f
Note On          Channel: 6 Data 1: 0x3c  Data 2: 0x7f
Key Pressure     Channel: 6 Data 1: 0x3c  Data 2: 0x40
Control Change   Channel: 2 Data 1: 0x07  Data 2: 0x78
Program Change   Channel: 9 Data 1: 0x06
Channel Pressure Channel: 3 Data 1: 0x40
Pitch Bend       Channel: 3 Data 1: 0x7f  Data 2: 0x7f (16383)
System Common    MTCQuarterFrame    Data 1: 0x2f
System Common    SongPositionPointer    Data 1: 0x10  Data 2: 0x4e (10000)
System Common    SongSelect Data 1: 0x46
System Common    TuneRequest
System Exclusive [10] F0 00 01 02 03 04 05 06 07 F7
System Exclusive [6+] F0 10 11 12 13 14
System Exclusive [6+] 15 16 17 18 19 1A
System Exclusive [6]  1B 1C 1D 1E 1F F7
Real-Time        TimingClock
Real-Time        Start
Real-Time        Continue
Real-Time        Stop
Real-Time        ActiveSensing
Real-Time        SystemReset
 
 
 
void setup() {
  while (!Serial)
    ;
 
  { 
    uint8_t velocity = 127;
    uint8_t pressure = 64;
    uint8_t value = 120;
    uint16_t bend = 16383;
  }
 
  { 
    uint8_t messageType = 2;
    uint8_t value = 15;
    uint16_t spp = 10000;
    uint8_t song = 70;
  }
 
  { 
    uint8_t sysex[] = {0xF0, 0x00, 0x01, 0x02, 0x03,
                       0x04, 0x5,  0x06, 0x07, 0xF7};
    uint8_t chunk1[] = {0xF0, 0x10, 0x11, 0x12, 0x13, 0x14};
    uint8_t chunk2[] = {0x15, 0x16, 0x17, 0x18, 0x19, 0x1A};
    uint8_t chunk3[] = {0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0xF7};
  }
 
  { 
  }
}
 
void loop() {
}
constexpr Channel Channel_6
constexpr Channel Channel_3
constexpr Channel Channel_2
constexpr Channel Channel_9
The main header file that includes all Control-Surface header files.
A type-safe class for MIDI channels.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
void sendChannelPressure(MIDIChannelCable address, uint8_t pressure)
Send a MIDI Channel Pressure event.
void sendSongSelect(uint8_t song, Cable cable=Cable_1)
Send a MIDI Song Select message.
void sendStop(Cable cable=Cable_1)
Send a MIDI Stop message.
void sendContinue(Cable cable=Cable_1)
Send a MIDI Continue message.
void sendSysEx(const uint8_t(&sysexdata)[N], Cable cable=Cable_1)
Send a MIDI System Exclusive message.
void sendProgramChange(MIDIAddress address)
Send a MIDI Program Change event.
void sendTimingClock(Cable cable=Cable_1)
Send a MIDI Timing Clock message.
void sendMTCQuarterFrame(uint8_t data, Cable cable=Cable_1)
Send a MIDI Time Code Quarter Frame.
void sendKeyPressure(MIDIAddress address, uint8_t pressure)
Send a MIDI Key Pressure event.
void sendSongPositionPointer(uint16_t spp, Cable cable=Cable_1)
Send a MIDI Song Position Pointer message.
void sendControlChange(MIDIAddress address, uint8_t value)
Send a MIDI Control Change event.
void sendStart(Cable cable=Cable_1)
Send a MIDI Start message.
void sendSystemReset(Cable cable=Cable_1)
Send a MIDI System Reset message.
void sendTuneRequest(Cable cable=Cable_1)
Send a MIDI Tune Request.
void sendNoteOn(MIDIAddress address, uint8_t velocity)
Send a MIDI Note On event.
void sendNoteOff(MIDIAddress address, uint8_t velocity)
Send a MIDI Note Off event.
void sendPitchBend(MIDIChannelCable address, uint16_t value)
Send a MIDI Pitch Bend event.
void sendActiveSensing(Cable cable=Cable_1)
Send a MIDI Active Sensing message.
void begin() override
Start the Serial interface at the predefined baud rate.
void update() override
Read the MIDI interface and call the callback if a message was received.
A class for debug MIDI interfaces sending and receiving human-readable MIDI messages over the USB CDC...
constexpr uint8_t Channel_Volume
constexpr uint8_t Harpsichord