Control Surface 2.1.2
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
Pitch-Bend-Value.ino

Pitch-Bend-Value

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

Boards: 🛈
AVR, AVR USB, Nano Every, Due, Nano 33 IoT, Nano 33 BLE, UNO R4, Pi Pico, Teensy 3.x, ESP32, ESP8266

Connections

None.

Behavior

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

Mapping

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
https://github.com/tttapa/Control-Surface

// Instantiate an object that listens for MIDI Pitch Bend messages on channel 1.
void setup() {
Control_Surface.begin();
Serial.begin(115200);
}
void loop() {
// If the Pitch Bend value changed
if (pb.getDirty()) {
// Print it
Serial.println(pb.getValue());
// Clear the dirty flag to acknowledge the change
pb.clearDirty();
}
}
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.
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
void clearDirty()
Clear the dirty flag.
Class that listens for MIDI Pitch Bend events on a single address and saves their value.
Definition PBValue.hpp:15
uint16_t getValue() const override
Get the most recent MIDI value that was received.
Definition PBValue.hpp:34
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.