Transposer
This is an example that demonstrates the use a Transposer to transpose the note events sent out by NoteButtons.
- Boards: 🛈
- AVR, AVR USB, Nano Every, Due, Nano 33 IoT, Nano 33 BLE, UNO R4, Pi Pico, Teensy 3.x, ESP32, ESP8266
Connections
- 2-9: momentary push buttons (to ground) to use as "piano keys"
- 10: momentary push button (to ground) to transpose one semitone up
- 11: momentary push button (to ground) to transpose one semitone down
The internal pull-up resistor for the buttons will be enabled automatically.
Behavior
- By default, the 8 push buttons on pins 2-9 send MIDI Note events for notes C4 - C5.
- If you press the push button on pin 10, all notes are transposed one semitone up.
- If you press the push button on pin 11, all notes are transposed one semitone down.
- If you press the push buttons on pins 10 and 11 simultaneously, the transposer resets.
Mapping
Route the Arduino MIDI port into a synth to play the notes.
Written by PieterP, 2019-10-26
https://github.com/tttapa/Control-Surface
transposer,
{10, 11},
};
};
void setup() {
}
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.
@ Clamp
When the maximum (minimum) setting is reached, clamp to the maximum (minimum) setting.
static constexpr uint8_t getNumberOfBanks()
Get the number of banks.
void begin()
Initialize the Control_Surface.
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
Selector with two buttons (one to increment, one to decrement).
Class for transposing the address of NoteButton and other MIDI elements.
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.