Hi! I'm starting a new project on a MIDI foot controller that I plan to use mainly for virtual amps, but I'd like to use it to loop in Ableton Live as well. My idea is to have 8 switches, 6 for presets, and two for bank up/down. I already managed to do that and it works great, but I want to add extra functionality and I don't know how to. Here is my code:
#include <Control_Surface.h>
USBMIDI_Interface midi;
Bank<2> bank(6);
IncrementDecrementSelectorLEDs<2> bankSelector = {
bank,
{A0, A1},
{11, 12},
Wrap::Wrap,
};
Bankable::CCButton button1 {
{bank, BankType::CHANGE_ADDRESS}, // bank configuration
2, // analog pin
{0, CHANNEL_1}, // address
};
Bankable::CCButton button2 {
{bank, BankType::CHANGE_ADDRESS}, // bank configuration
3, // analog pin
{1, CHANNEL_1}, // address
};
Bankable::CCButton button3 {
{bank, BankType::CHANGE_ADDRESS}, // bank configuration
4, // analog pin
{2, CHANNEL_1}, // address
};
Bankable::CCButton button4 {
{bank, BankType::CHANGE_ADDRESS}, // bank configuration
5, // analog pin
{3, CHANNEL_1}, // address
};
Bankable::CCButton button5 {
{bank, BankType::CHANGE_ADDRESS}, // bank configuration
6, // analog pin
{4, CHANNEL_1}, // address
};
Bankable::CCButton button6 {
{bank, BankType::CHANGE_ADDRESS}, // bank configuration
7, // analog pin
{5, CHANNEL_1}, // address
};
void setup() {
Control_Surface.begin(); // Initialize the Control Surface library
}
void loop() {
Control_Surface.loop(); // Update the Control Surface library
}
I'd like to implement the following things:
-Make one of the banks a set of different type of buttons. For example, now all of them are momentary CCs, but I want to make Bank 1 to be latched and bank 2 to be momentary (is that possible?)
-LEDs that turn on whenever I press a button, but respecting the actual bank. What I mean is associating the led to the CC message that the button is sending rather than to the button itself, and also respectig if the button is latched or momentary. For example, I press a latched button in bank 1, then scroll to bank 2 and press a momentary button, but I want the first one to remain pressed and the second one only to light when the second button is pressed.
-Make buttons behave differently based on long or multiple presses, for example, sending different CC messages depending on that.
-Add a toggle switch to turn all of the eight switches (including the two bank scrollers) into a set of other CC messages, so I can controll Ableton Live (this would be like entering "looper mode"), but I want this to be independent of the earlier preset banks, and even make the selector leds turn off when entering this "looper mode".
I'm sorry but I'm quite new at programming. I found this Control Surface library that I think is very helpful and versatile, but I need help understanding all its functions.
I'm using an Arduino UNO with the dual mocolufa firmware so it can act as a USB midi device.
Thanks in advance and sorry for the previous multiple post confusion.