Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
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, UNO R4, Pi Pico, 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
Poll the backend (if necessary) and invoke the callbacks for any received MIDI messages,...
void begin() override
Initialize.
A class for MIDI interfaces sending and receiving MIDI messages over a Hardware Serial port.
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.