This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
Dual-MIDI-Interface.ino

Dual-MIDI-Interface

This example demonstrates how to group together two or more MIDI interfaces, so you can send the MIDI output over both MIDI USB and 5-pin DIN MIDI, for example. MIDI input is received from all interfaces as well.

Boards:
AVR USB, Teensy 3.x

Connections

Connect the left terminal of the potentiometer to ground, and the right one to VCC.

Behavior

Mapping

Written by PieterP, 2019-08-22
https://github.com/tttapa/Control-Surface

// Create two MIDI interfaces
HardwareSerialMIDI_Interface serialmidi = {Serial1, MIDI_BAUD};
// And group them together
MultiMIDI_Interface<2> midi = {{&usbmidi, &serialmidi}};
// The MIDI interface that was instantiated last will be used as the
// default MIDI interface by Control_Surface.
// To override the default, you can use the following line in your setup:
// `midi.setAsDefault();`
// where `midi` is the MIDI interface you want to set as the default.
// Add some MIDI elements to show that the MIDI interfaces actually work
NoteValueLED led = {LED_BUILTIN, 0x3C};
void setup() {
}
void loop() {
}
USBMIDI_Interface
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
Definition: USBMIDI_Interface.hpp:43
MIDI_BAUD
constexpr auto MIDI_BAUD
Definition: MIDI_Interface.hpp:9
Control_Surface.h
The main header file that includes all Control-Surface header files.
Control_Surface
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
Definition: Control_Surface_Class.cpp:171
HardwareSerialMIDI_Interface
A class for MIDI interfaces sending and receiving MIDI messages over a Serial port of class T.
Definition: SerialMIDI_Interface.hpp:113
NoteValueLED
Definition: NoteCCRangeLEDs.hpp:44
CCPotentiometer
A class of MIDIOutputElements that read the analog input from a potentiometer or fader,...
Definition: CCPotentiometer.hpp:19
MIDI_CC::General_Purpose_Controller_1
constexpr uint8_t General_Purpose_Controller_1
Definition: Control_Change.hpp:32
Control_Surface_::begin
void begin()
Initialize the Control_Surface.
Definition: Control_Surface_Class.cpp:22
MultiMIDI_Interface
A class for grouping multiple MIDI interfaces in parallel.
Definition: MultiMIDI_Interface.hpp:16
Control_Surface_::loop
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
Definition: Control_Surface_Class.cpp:45