MIDI Control Surface library for Arduino
|
MIDI-Controller-Finished-Example
This is the code I used for my specific MIDI controller.
- Boards:
- Leonardo
Connections
I used an Arduino Leonardo with:
- 4 faders on A0-A3
- 8 potentiometers on A4-A11
- 1 rotary encoder on pins 0-1
- 4 toggle switches on pins 2, 3, 5 and 7
- 1 toggle switch (for bank select) on pin 11
- 1 LED on pin 13
Behavior
- When bank select is 0, faders 1-4 are channel volumes 1-4, potSide 1-4 are pan/balance of channel 1-4, switches 1-4 are mute channel 5-8.
- When bank select is 1, faders 1-4 are channel volumes 5-8, potSide 1-4 are pan/balance of channel 5-8, switches 1-4 are mute channel 1-4.
- PotTop 1-4 are not in the bank, because I use them as effect or EQ parameters, and they are channel independent.
- Enc1 is used for scrolling.
Mapping
Create a custom mapping using the MIDI learn option in your DAW.
Written by PieterP, 07-09-2017 https://github.com/tttapa/Control-Surface
#include <Encoder.h>
const int speedMultiplier = 1;
};
};
};
};
{1, 0},
speedMultiplier,
4,
};
void setup() {
}
void loop() {
}
void pinMode(pin_t pin, uint8_t mode)
An ExtIO version of the Arduino function.
constexpr uint8_t General_Purpose_Controller_3
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
A class that groups Bankable BankableMIDIOutputs and BankableMIDIInputs, and allows the user to chang...
int digitalRead(pin_t pin)
An ExtIO version of the Arduino function.
constexpr Channel CHANNEL_3
constexpr uint8_t General_Purpose_Controller_4
constexpr uint8_t General_Purpose_Controller_2
The main header file that includes all Control-Surface header files.
A class of MIDIOutputElements that read the analog input from a potentiometer or fader,...
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
constexpr uint8_t Channel_Volume
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
Change the offset of the channel number of the element.
constexpr Channel CHANNEL_4
Selector that selects one of two settings, based on the state of a toggle or momentary switch.
constexpr uint8_t General_Purpose_Controller_1
A class of MIDIOutputElements that read the input of a quadrature (rotary) encoder and send out relat...
A class of MIDIOutputElements that read the analog input from a potentiometer or fader,...
constexpr uint8_t General_Purpose_Controller_5
constexpr Channel CHANNEL_2
Change the offset of the address (i.e.
void digitalWrite(pin_t pin, uint8_t val)
An ExtIO version of the Arduino function.
constexpr Channel CHANNEL_1
void begin()
Initialize the Control_Surface.