Control Surface master
MIDI Control Surface library for Arduino
MIDI_Pipes-Routing.ino

MIDI_Pipes-Routing

MIDI routing using MIDI_Pipes.

Bridges the USB MIDI interface to a Serial MIDI interface, and loops back anything it receives on the USB interface.

You can also use the MIDI pipes to route the input and output of Control Surface itself, not just the input and output of MIDI interfaces. This is demonstrated in the Dual-MIDI-Interface.ino example.

Boards:
AVR USB, Due, Nano 33 IoT, Nano 33 BLE, Teensy 3.x, ESP32
HardwareSerialMIDI_Interface midiser = Serial1;
void setup() {
midiusb >> pipes >> midiser; // all incoming midi from USB is sent to serial
midiusb << pipes << midiser; // all incoming midi from Serial is sent to USB
midiusb >> pipes >> midiusb; // all incoming midi from USB is looped back
midiusb.begin();
midiser.begin();
}
void loop() {
midiusb.update();
midiser.update();
}
The main header file that includes all Control-Surface header files.
void update() override
Read the MIDI interface and call the callback if a message was received.
A class for MIDI interfaces sending and receiving MIDI messages over a Hardware Serial port.
void begin() override
Initialize the MIDI Interface.
void update() override
Read the MIDI interface and call the callback if a message was received.
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
Class that produces multiple MIDI_Pipes.
Definition: MIDI_Pipes.hpp:645