Control Surface  1.2.0
MIDI Control Surface library for Arduino
CCIncrementDecrementButtons.ino

CCIncrementDecrementButtons

This is an example that demonstrates the use of Increment and Decrement buttons that can be used for scrolling through a song list, tuning effects, etc.
You can compare it to a rotary encoder, but with two buttons instead of an encoder.

Boards:
AVR, AVR USB, Nano Every, Due, Nano 33, Teensy 3.x, ESP32

Connections

The internal pull-up resistors for the buttons will be enabled automatically.

Behavior

Map the Arduino as a Mackie Control Universal (MCU) or equivalent in your audio software.

Written by PieterP, 2019-01-26
https://github.com/tttapa/Control-Surface

#include <Control_Surface.h> // Include the Control Surface library
// Instantiate a MIDI over USB interface.
// Instantiate a CCIncrementDecrementButtons object
{5, 6}, // Button pins: 5 increments, 6 decrements
MCU::V_POT_1, // Increment/Decrement CC address
1, // Multiplier
MCU::V_POT_SELECT_1, // Reset note address
};
void setup() {
// Use the Mackie Control protocol for sending relative MIDI CC messages.
Control_Surface.begin(); // Initialize Control Surface
}
void loop() {
Control_Surface.loop(); // Update the control surface
}
USBMIDI_Interface
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
Definition: USBMIDI_Interface.hpp:41
MACKIE_CONTROL_RELATIVE
@ MACKIE_CONTROL_RELATIVE
Relative mode used by the Mackie Control Universal protocol.
Definition: RelativeCCSender.hpp:72
RelativeCCSender::setMode
static void setMode(relativeCCmode mode)
Set the relative CC mode that's used.
Definition: RelativeCCSender.hpp:134
Control_Surface.h
The main header file that includes all Control-Surface header files.
Control_Surface_::loop
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
Definition: Control_Surface_Class.cpp:68
MCU::V_POT_1
constexpr uint8_t V_POT_1
Definition: MCU.hpp:159
CCIncrementDecrementButtons
A class of MIDIOutputElements that read the input of two momentary push buttons to increment or decre...
Definition: CCIncrementDecrementButtons.hpp:21
Control_Surface
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
Definition: Control_Surface_Class.cpp:203
MCU::V_POT_SELECT_1
constexpr uint8_t V_POT_SELECT_1
Definition: MCU.hpp:58
Control_Surface_::begin
void begin()
Initialize the Control_Surface.
Definition: Control_Surface_Class.cpp:25