Control Surface  1.1.0
MIDI Control Surface library for Arduino
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/dd/dcc/md_Getting-Started.html

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

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

/**
* This is the second example used in the 'Getting Started' guide:
* https://tttapa.github.io/Control-Surface/Doc/Doxygen/dd/dcc/md_Getting-Started.html
*
* @boards AVR, AVR USB, Due, Nano 33, Teensy 3.x, ESP32
*
* @htmlonly
* <iframe width="560" height="315"
* src="https://www.youtube.com/embed/u1IbYXPT6mM?loop=1" frameborder="0"
* allow="accelerometer; autoplay; encrypted-media; gyroscope;
* picture-in-picture" allowfullscreen></iframe>
* @endhtmlonly
*
* 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 = {
10, // Latch pin (ST_CP)
MSBFIRST, // Byte order
};
using namespace MIDI_Notes;
// Create an array of LEDs that listen to MIDI Note messages, turning on and off
// the LEDs connected to the eight input pins of the shift register
NoteValueLED leds[] = {
{sreg.pin(0), note(C, 4)}, // LED pin, address (note number, channel, cable)
{sreg.pin(1), note(D, 4)}, //
{sreg.pin(2), note(E, 4)}, //
{sreg.pin(3), note(F, 4)}, //
{sreg.pin(4), note(G, 4)}, //
{sreg.pin(5), note(A, 4)}, //
{sreg.pin(6), note(B, 4)}, //
{sreg.pin(7), note(C, 5)}, //
};
// Initialize the Control Surface
void setup() {
}
// Update the Control Surface
void loop() {
}
MIDI_Notes::A
constexpr int8_t A
Definition: Notes.hpp:27
USBMIDI_Interface
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
Definition: USBMIDI_Interface.hpp:43
MIDI_Notes::G
constexpr int8_t G
Definition: Notes.hpp:25
MIDI_Notes::E
constexpr int8_t E
Definition: Notes.hpp:22
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:174
MIDI_Notes::note
constexpr int8_t note(int8_t note, int8_t numOctave)
Get the MIDI note in the given octave.
Definition: Notes.hpp:35
NoteValueLED
Definition: NoteCCRangeLEDs.hpp:49
MIDI_Notes::D
constexpr int8_t D
Definition: Notes.hpp:20
Control_Surface_::begin
void begin()
Initialize the Control_Surface.
Definition: Control_Surface_Class.cpp:25
MIDI_Notes::B
constexpr int8_t B
Definition: Notes.hpp:29
MIDI_Notes::C
constexpr int8_t C
Definition: Notes.hpp:18
MIDI_Notes
MIDI note names.
Definition: Notes.hpp:16
Control_Surface_::loop
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
Definition: Control_Surface_Class.cpp:48
MIDI_Notes::F
constexpr int8_t F
Definition: Notes.hpp:23