Control Surface master
MIDI Control Surface library for Arduino


This example demonstrates how to listen for incoming MIDI Pitch Bend events.

AVR, AVR USB, Nano Every, Due, Nano 33 IoT, Nano 33 BLE, Teensy 3.x, ESP32




If a MIDI Pitch Bend message on channel 1 is received, its value is printed to the serial port.


Route the MIDI output of a program or device that sends MIDI Pitch Bend messages to the Arduino's MIDI input.

Written by PieterP, 2020-09-08

// Instantiate an object that listens for MIDI Pitch Bend messages on channel 1.
void setup() {
void loop() {
// If the Pitch Bend value changed
if (pb.getDirty()) {
// Print it
// Clear the dirty flag to acknowledge the change
constexpr Channel CHANNEL_1
Definition: Channel.hpp:118
The main header file that includes all Control-Surface header files.
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
void begin()
Initialize the Control_Surface.
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
Class that listens for MIDI Pitch Bend events on a single address and saves their value.
Definition: PBValue.hpp:15
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.