Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
2.First-Input.ino

2.First-Input

This is the second example used in the 'Getting Started' guide: https://tttapa.github.io/Control-Surface-doc/Doxygen/d5/d7d/md_pages_Getting-Started.html

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

Written by PieterP, 2018-08-29
https://github.com/tttapa/Control-Surface

// Include the library
// Instantiate a MIDI Interface to use
// Instantiate a shift register as output for the LEDs
SPIShiftRegisterOut<8> sreg {
SPI, // SPI interface to use
10, // Latch pin (ST_CP)
MSBFIRST, // Byte order
};
// Create an array of LEDs that listen to MIDI Note messages, turning on and off
// the LEDs connected to the eight output pins of the shift register
NoteLED leds[] {
{sreg.pin(0), MIDI_Notes::C[4]}, // LED pin, address (note number, channel, cable)
{sreg.pin(1), MIDI_Notes::D[4]}, //
{sreg.pin(2), MIDI_Notes::E[4]}, //
{sreg.pin(3), MIDI_Notes::F[4]}, //
{sreg.pin(4), MIDI_Notes::G[4]}, //
{sreg.pin(5), MIDI_Notes::A[4]}, //
{sreg.pin(6), MIDI_Notes::B[4]}, //
{sreg.pin(7), MIDI_Notes::C[5]}, //
};
// Initialize the Control Surface
void setup() {
}
// Update the Control Surface
void loop() {
}
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.
Generic base class for classes that listen for MIDI Note, Control Change and Key Pressure events on a...
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
constexpr Note F
F (Fa)
Definition Notes.hpp:61
constexpr Note G
G (Sol)
Definition Notes.hpp:63
constexpr Note E
E (Mi)
Definition Notes.hpp:60
constexpr Note B
B (Si)
Definition Notes.hpp:67
constexpr Note A
A (La)
Definition Notes.hpp:65
constexpr Note C
C (Do)
Definition Notes.hpp:56
constexpr Note D
D (Re)
Definition Notes.hpp:58