#include <MIDI_Interfaces/DebugMIDI_Interface.hpp>
A class for debug MIDI outputs sending human-readable MIDI messages over the USB CDC connection.
Boards without a native USB connection (UNO, MEGA, Nano ...) use HardwareSerial0 for USB communication.
Definition at line 154 of file DebugMIDI_Interface.hpp.
Inheritance diagram for USBDebugMIDI_Output:
Collaboration diagram for USBDebugMIDI_Output:Enabling and disabling updatables | |
| void | enable () |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
| void | enable () |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
| void | disable () |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
| void | disable () |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
| bool | isEnabled () const |
| Check if this updatable is enabled. | |
| bool | isEnabled () const |
| Check if this updatable is enabled. | |
| void | moveDown () |
| Move down this element in the list. | |
| void | moveDown () |
| Move down this element in the list. | |
| static void | enable (UpdatableCRTP *element) |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
| static void | enable (UpdatableCRTP &element) |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
| static void | enable (U(&array)[N]) |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
| static void | enable (UpdatableCRTP *element) |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
| static void | enable (UpdatableCRTP &element) |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
| static void | enable (U(&array)[N]) |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
| static void | disable (UpdatableCRTP *element) |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
| static void | disable (UpdatableCRTP &element) |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
| static void | disable (U(&array)[N]) |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
| static void | disable (UpdatableCRTP *element) |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
| static void | disable (UpdatableCRTP &element) |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
| static void | disable (U(&array)[N]) |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
Sending MIDI Channel Voice messages | |
| void | send (ChannelMessage message) |
| Send a MIDI Channel Voice message. | |
| void | sendChannelMessage (MIDIMessageType m, Channel c, uint8_t d1, uint8_t d2, Cable cable=Cable_1) |
| Send a 3-byte MIDI Channel Voice message. | |
| void | sendChannelMessage (MIDIMessageType m, Channel c, uint8_t d1, Cable cable=Cable_1) |
| Send a 2-byte MIDI Channel Voice message. | |
| 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 | sendKeyPressure (MIDIAddress address, uint8_t pressure) |
| Send a MIDI Key Pressure event. | |
| void | sendControlChange (MIDIAddress address, uint8_t value) |
| Send a MIDI Control Change event. | |
| void | sendProgramChange (MIDIAddress address) |
| Send a MIDI Program Change event. | |
| void | sendProgramChange (MIDIChannelCable address, uint8_t value) |
| Send a MIDI Program Change event. | |
| void | sendChannelPressure (MIDIChannelCable address, uint8_t pressure) |
| Send a MIDI Channel Pressure event. | |
| void | sendPitchBend (MIDIChannelCable address, uint16_t value) |
| Send a MIDI Pitch Bend event. | |
Sending MIDI System Common messages | |
| void | send (SysCommonMessage message) |
| Send a MIDI System Common message. | |
| void | sendSysCommon (MIDIMessageType m, Cable cable=Cable_1) |
| Send a MIDI System Common message. | |
| void | sendSysCommon (MIDIMessageType m, uint8_t data1, Cable cable=Cable_1) |
| Send a MIDI System Common message. | |
| void | sendSysCommon (MIDIMessageType m, uint8_t data1, uint8_t data2, Cable cable=Cable_1) |
| Send a MIDI System Common message. | |
| void | sendMTCQuarterFrame (uint8_t data, Cable cable=Cable_1) |
| Send a MIDI Time Code Quarter Frame. | |
| void | sendMTCQuarterFrame (uint8_t messageType, uint8_t values, Cable cable=Cable_1) |
| Send a MIDI Time Code Quarter Frame. | |
| void | sendSongPositionPointer (uint16_t spp, Cable cable=Cable_1) |
| Send a MIDI Song Position Pointer message. | |
| void | sendSongSelect (uint8_t song, Cable cable=Cable_1) |
| Send a MIDI Song Select message. | |
| void | sendTuneRequest (Cable cable=Cable_1) |
| Send a MIDI Tune Request. | |
Sending MIDI System Exclusive messages | |
| void | send (SysExMessage message) |
| Send a MIDI System Exclusive message. | |
| void | sendSysEx (const uint8_t(&sysexdata)[N], Cable cable=Cable_1) |
| Send a MIDI System Exclusive message. | |
| void | sendSysEx (const uint8_t *data, uint16_t length, Cable cable=Cable_1) |
| Send a MIDI System Exclusive message. | |
Sending MIDI Real-Time messages | |
| void | send (RealTimeMessage message) |
| Send a MIDI Real-Time message. | |
| void | sendRealTime (MIDIMessageType rt, Cable cable=Cable_1) |
| Send a MIDI Real-Time message. | |
| void | sendRealTime (uint8_t rt, Cable cable=Cable_1) |
| Send a MIDI Real-Time message. | |
| void | sendTimingClock (Cable cable=Cable_1) |
| Send a MIDI Timing Clock message. | |
| void | sendStart (Cable cable=Cable_1) |
| Send a MIDI Start message. | |
| void | sendContinue (Cable cable=Cable_1) |
| Send a MIDI Continue message. | |
| void | sendStop (Cable cable=Cable_1) |
| Send a MIDI Stop message. | |
| void | sendActiveSensing (Cable cable=Cable_1) |
| Send a MIDI Active Sensing message. | |
| void | sendSystemReset (Cable cable=Cable_1) |
| Send a MIDI System Reset message. | |
Flushing the MIDI send buffer | |
| void | sendNow () |
| Causes all buffered messages to be sent immediately. | |
Deprecated | |
| void | sendKP (MIDIAddress address, uint8_t pressure) |
| Send a MIDI Key Pressure event. | |
| void | sendCC (MIDIAddress address, uint8_t value) |
| Send a MIDI Control Change event. | |
| void | sendPC (MIDIAddress address) |
| Send a MIDI Program Change event. | |
| void | sendPC (MIDIChannelCable address, uint8_t value) |
| Send a MIDI Program Change event. | |
| void | sendCP (MIDIChannelCable address, uint8_t pressure) |
| Send a MIDI Channel Pressure event. | |
| void | sendPB (MIDIChannelCable address, uint16_t value) |
| Send a MIDI Pitch Bend event. | |
Connecting and disconnecting MIDI Pipes | |
| void | connectSourcePipe (MIDI_Pipe *source) |
| Fully connect a source pipe to this sink. | |
| void | disconnectSourcePipes () |
| Disconnect all source pipes that sink to this sink (recursively). | |
| bool | disconnect (TrueMIDI_Source &source) |
| Disconnect the given source from this sink. | |
| bool | disconnect (MIDI_Pipe &)=delete |
| bool | hasSourcePipe () const |
| Check if this sink is connected to a source pipe. | |
| MIDI_Pipe * | getSourcePipe () const |
Get a pointer to the pipe this sink is connected to, or nullptr if not connected. | |
Public Member Functions | |
| USBDebugMIDI_Output (unsigned long baud=AH::defaultBaudRate, const char *prefix=nullptr) | |
| Construct a USBDebugMIDI_Output with the given baud rate. | |
| USBDebugMIDI_Output (const char *prefix) | |
| void | begin () override |
| Start the Serial interface at the predefined baud rate. | |
| Print & | getStream () const |
| void | setPrefix (const char *prefix) |
| Set the prefix to be printed before each message. | |
| const char * | getPrefix () const |
Static Public Member Functions | |
| static void | beginAll () |
| static void | swap (MIDI_Sink &a, MIDI_Sink &b) |
Protected Member Functions | |
| void | sendChannelMessageImpl (ChannelMessage) |
| void | sendChannelMessageImpl (Print &, ChannelMessage) |
| void | sendSysCommonImpl (SysCommonMessage) |
| void | sendSysCommonImpl (Print &, SysCommonMessage) |
| void | sendSysExImpl (SysExMessage) |
| void | sendSysExImpl (Print &, SysExMessage) |
| void | sendRealTimeImpl (RealTimeMessage) |
| void | sendRealTimeImpl (Print &, RealTimeMessage) |
| void | sendNowImpl () |
| void | sendNowImpl (Print &) |
| void | sinkMIDIfromPipe (ChannelMessage m) override |
| Accept an incoming MIDI Channel message. | |
| void | sinkMIDIfromPipe (SysExMessage m) override |
| Accept an incoming MIDI System Exclusive message. | |
| void | sinkMIDIfromPipe (SysCommonMessage m) override |
| Accept an incoming MIDI System Common message. | |
| void | sinkMIDIfromPipe (RealTimeMessage m) override |
| Accept an incoming MIDI Real-Time message. | |
Protected Attributes | |
| Node * | next = nullptr |
| Node * | previous = nullptr |
| Print & | stream |
| friend | MIDI_Sender< StreamDebugMIDI_Output > |
| MIDI_Pipe * | sourcePipe = nullptr |
Static Protected Attributes | |
| static DoublyLinkedList< MIDIOutputOnly > | updatables |
| static DoublyLinkedList< MIDIOutputOnly > | updatables |
Private Member Functions | |
| virtual void | stallDownstream (MIDIStaller *, MIDI_Source *) |
| Base case for recursive stall function. | |
| virtual void | unstallDownstream (MIDIStaller *, MIDI_Source *) |
| Base case for recursive un-stall function. | |
| virtual MIDI_Sink * | getFinalSink () |
| Base case for recursive function. | |
| void | disconnectSourcePipesShallow () |
| Disconnect only the first pipe connected to this sink. | |
Private Attributes | |
| const unsigned long | baud |
| const char * | prefix = nullptr |
|
inline |
Construct a USBDebugMIDI_Output with the given baud rate.
| baud | The baud rate to start the USB Serial connection with. |
| prefix | An optional string to print before each message. |
Definition at line 164 of file DebugMIDI_Interface.hpp.
|
inline |
Definition at line 168 of file DebugMIDI_Interface.hpp.
|
inlineoverridevirtualinherited |
Start the Serial interface at the predefined baud rate.
Implements MIDIOutputOnly.
Definition at line 110 of file DebugMIDI_Interface.hpp.
Definition at line 72 of file DebugMIDI_Interface.hpp.
|
inlineinherited |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 96 of file Updatable.hpp.
|
inlinestaticinherited |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 125 of file Updatable.hpp.
|
inlinestaticinherited |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 127 of file Updatable.hpp.
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 130 of file Updatable.hpp.
|
inlineinherited |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 96 of file Updatable.hpp.
|
inlinestaticinherited |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 125 of file Updatable.hpp.
|
inlinestaticinherited |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 127 of file Updatable.hpp.
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 130 of file Updatable.hpp.
|
inlineinherited |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 106 of file Updatable.hpp.
|
inlinestaticinherited |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 136 of file Updatable.hpp.
|
inlinestaticinherited |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 138 of file Updatable.hpp.
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 141 of file Updatable.hpp.
|
inlineinherited |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 106 of file Updatable.hpp.
|
inlinestaticinherited |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 136 of file Updatable.hpp.
|
inlinestaticinherited |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 138 of file Updatable.hpp.
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 141 of file Updatable.hpp.
|
inlineinherited |
Check if this updatable is enabled.
Definition at line 120 of file Updatable.hpp.
|
inlineinherited |
Check if this updatable is enabled.
Definition at line 120 of file Updatable.hpp.
|
inlineinherited |
Move down this element in the list.
Definition at line 147 of file Updatable.hpp.
|
inlineinherited |
Move down this element in the list.
Definition at line 147 of file Updatable.hpp.
|
inlineinherited |
Definition at line 47 of file DebugMIDI_Interface.hpp.
|
protectedinherited |
Definition at line 125 of file DebugMIDI_Interface.cpp.
|
protectedinherited |
Definition at line 52 of file DebugMIDI_Interface.cpp.
|
protectedinherited |
Definition at line 128 of file DebugMIDI_Interface.cpp.
|
protectedinherited |
Definition at line 93 of file DebugMIDI_Interface.cpp.
|
protectedinherited |
Definition at line 131 of file DebugMIDI_Interface.cpp.
|
protectedinherited |
Definition at line 79 of file DebugMIDI_Interface.cpp.
|
protectedinherited |
Definition at line 134 of file DebugMIDI_Interface.cpp.
|
protectedinherited |
Definition at line 113 of file DebugMIDI_Interface.cpp.
|
protectedinherited |
Definition at line 137 of file DebugMIDI_Interface.cpp.
|
inlineprotectedinherited |
Definition at line 21 of file DebugMIDI_Interface.hpp.
|
inlineoverrideprotectedvirtualinherited |
Accept an incoming MIDI Channel message.
Implements MIDI_Sink.
Definition at line 57 of file DebugMIDI_Interface.hpp.
|
inlineoverrideprotectedvirtualinherited |
Accept an incoming MIDI System Exclusive message.
Implements MIDI_Sink.
Definition at line 58 of file DebugMIDI_Interface.hpp.
|
inlineoverrideprotectedvirtualinherited |
Accept an incoming MIDI System Common message.
Implements MIDI_Sink.
Definition at line 59 of file DebugMIDI_Interface.hpp.
|
inlineoverrideprotectedvirtualinherited |
Accept an incoming MIDI Real-Time message.
Implements MIDI_Sink.
Definition at line 60 of file DebugMIDI_Interface.hpp.
Set the prefix to be printed before each message.
Definition at line 27 of file DebugMIDI_Interface.hpp.
Definition at line 28 of file DebugMIDI_Interface.hpp.
|
inherited |
Send a MIDI Channel Voice message.
|
inherited |
Send a MIDI System Common message.
|
inherited |
Send a MIDI System Exclusive message.
|
inherited |
Send a MIDI Real-Time message.
|
inherited |
Send a 3-byte MIDI Channel Voice message.
| m | MIDI message type. [0x80, 0xE0] |
| c | The MIDI channel. [1, 16] |
| d1 | The first data byte. [0, 127] |
| d2 | The second data byte. [0, 127] |
| cable | The MIDI Cable Number. [Cable_1, Cable_16] |
|
inherited |
Send a 2-byte MIDI Channel Voice message.
| m | MIDI message type. [0x80, 0xE0] |
| c | The MIDI channel. [1, 16] |
| d1 | The first data byte. [0, 127] |
| cable | The MIDI Cable Number. [1, 16] |
|
inherited |
Send a MIDI Note On event.
|
inherited |
Send a MIDI Note Off event.
|
inherited |
Send a MIDI Key Pressure event.
|
inherited |
Send a MIDI Control Change event.
|
inherited |
Send a MIDI Program Change event.
|
inherited |
Send a MIDI Program Change event.
|
inherited |
Send a MIDI Channel Pressure event.
|
inherited |
Send a MIDI Pitch Bend event.
|
inherited |
Send a MIDI System Common message.
|
inherited |
Send a MIDI System Common message.
|
inherited |
Send a MIDI System Common message.
Send a MIDI Time Code Quarter Frame.
Send a MIDI Time Code Quarter Frame.
Send a MIDI Song Position Pointer message.
Send a MIDI Song Select message.
Send a MIDI System Exclusive message.
Send a MIDI System Exclusive message.
|
inherited |
Send a MIDI Real-Time message.
|
inherited |
Causes all buffered messages to be sent immediately.
|
inherited |
Send a MIDI Key Pressure event.
|
inherited |
Send a MIDI Control Change event.
|
inherited |
Send a MIDI Program Change event.
|
inherited |
Send a MIDI Program Change event.
|
inherited |
Send a MIDI Channel Pressure event.
|
inherited |
Send a MIDI Pitch Bend event.
Fully connect a source pipe to this sink.
Definition at line 17 of file MIDI_Pipes.cpp.
|
inherited |
Disconnect all source pipes that sink to this sink (recursively).
Definition at line 26 of file MIDI_Pipes.cpp.
|
inherited |
Disconnect the given source from this sink.
Leaves other sources connected. Returns true if the source was found and disconnected, false if the given source was not a direct or indirect source to this sink.
Definition at line 41 of file MIDI_Pipes.cpp.
|
inlineinherited |
Check if this sink is connected to a source pipe.
Definition at line 121 of file MIDI_Pipes.hpp.
|
inlineinherited |
Get a pointer to the pipe this sink is connected to, or nullptr if not connected.
Definition at line 124 of file MIDI_Pipes.hpp.
|
inlineprivatevirtualinherited |
Base case for recursive stall function.
Reimplemented in MIDI_Pipe.
Definition at line 131 of file MIDI_Pipes.hpp.
|
inlineprivatevirtualinherited |
Base case for recursive un-stall function.
Reimplemented in MIDI_Pipe.
Definition at line 134 of file MIDI_Pipes.hpp.
Base case for recursive function.
Reimplemented in MIDI_Pipe.
Definition at line 137 of file MIDI_Pipes.hpp.
|
privateinherited |
Disconnect only the first pipe connected to this sink.
Leaves the other pipes connected to the original pipe, which doesn't have a sink anymore when this function finishes. Used to disconnect a MIDI_Pipe while preserving the connections of its “through” inputs.
Definition at line 34 of file MIDI_Pipes.cpp.
Definition at line 57 of file MIDI_Pipes.cpp.
Definition at line 113 of file DebugMIDI_Interface.hpp.
|
staticprotectedinherited |
Definition at line 152 of file Updatable.hpp.
|
staticprotectedinherited |
Definition at line 152 of file Updatable.hpp.
Definition at line 320 of file LinkedList.hpp.
Definition at line 321 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 63 of file DebugMIDI_Interface.hpp.
|
protectedinherited |
Definition at line 65 of file DebugMIDI_Interface.hpp.
Definition at line 31 of file DebugMIDI_Interface.hpp.
Definition at line 146 of file MIDI_Pipes.hpp.