Control Surface
main
MIDI Control Surface library for Arduino
|
This is an example that demonstrates the use of Banks.
Banks allow you to use a single control for many different actions. By changing the bank setting, you can change the address of a MIDI Element.
In this example, we will use two potentiometers to control the volume of eight MIDI channels by using four banks.
The setup is as follows:
═══════════ ─╮ ═════════════════ Channel 1 │ Potentiometer 1 ────────── │ Bank 1 ──────────────── Channel 2 │ Potentiometer 2 ═══════════ ─┤ ═════════════════ Channel 3 │ Potentiometer 1 ────────── │ Bank 2 ──────────────── Channel 4 │ Potentiometer 2 ═══════════ ─┤ ═════════════════ Channel 5 │ Potentiometer 1 ────────── │ Bank 3 ──────────────── Channel 6 │ Potentiometer 2 ═══════════ ─┤ ═════════════════ Channel 7 │ Potentiometer 1 ────────── │ Bank 4 ──────────────── Channel 8 │ Potentiometer 2 ═══════════ ─╯ ═════════════════
When Bank 1 is selected, Potentiometer 1 controls Channel 1, and Potentiometer 2 controls Channel 2.
When Bank 2 is selected, Potentiometer 1 controls Channel 3, and Potentiometer 2 controls Channel 4.
When Bank 3 is selected, Potentiometer 1 controls Channel 5, and Potentiometer 2 controls Channel 6.
When Bank 4 is selected, Potentiometer 1 controls Channel 7, and Potentiometer 2 controls Channel 8.
To select the active bank, you can either use the Bank::select method, or you can use one of the many Selectors.
In this example, we'll use an IncrementDecrementSelector. It has one push button to increment the bank setting, and one push button to decrement the bank setting.
To display which bank is currently active, you can use the Selectors with LED feedback in the Selectors LEDs module, or you can write your own callback that gets called when the setting changes. The latter is demonstrated in the Custom-Selector-Callback.ino example.
For more information about banks, have a look at the “How do banks work?” FAQ page, it includes a nice animation.
Connect the left terminal of the potentiometer to ground, and the right one to VCC.
The internal pull-up resistors for the buttons will be enabled automatically.
Written by PieterP, 2020-02-04
https://github.com/tttapa/Control-Surface