(MIDI) Control Surface library - MIDI Controller

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.

Most classes have enable/disable methods you could use. See e.g. Control Surface: CCButton Class Reference.

Hi @fchiabudini ,

What is a CC control? What is a CC button?

I'm somehow experienced in programming. But I'm unexperienced regarding MIDI and MIDI-controls.
You are writing in technical terms that are specific to MIDI.

If you:

  • describe in more general words what your wanted functionality is.
  • write what exact type of microcontroller you are using

the probabilty to get helpful answers will be higher.

best regards Stefan

I'm sorry if I was not specific enough about the terms. CC is a type of MIDI message called Control Change, and ranges between 0 to 127 values. In this case, a CC button is a switch that, when pressed, sends a CC message with value 127, and when released, sends the same CC message but with value 0.

In this case, with this library I can make buttons bankable, meaning I only have 6 buttons, but when changing banks, I can have "more buttons" (same six but they send different messages). The buttons responsible for changin banks do not send midi messages, and that's what I want to change with another toggle button: in one mode, those two bank buttons work as that, but in other mode, they work like two CC buttons.

I'm sorry but I'm just starting with all this. Can you please tell me how this would help me and how is it used in code?

If you scroll up, then you can edit the title of this topic.
I think this is a question about Midi, then please put that in the title.
Which Arduino board do you use ?

Link to the Control Surface library: https://github.com/tttapa/Control-Surface

(post deleted by author)

Why open a new thread for the same project?

I have merged your topics due to them having too much overlap on the same subject matter @fchiabudini.

In the future, please only create one topic for each distinct subject matter and be careful not to cause them to converge into parallel discussions.

The reason is that generating multiple threads on the same subject matter can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Thanks in advance for your cooperation.

I'm sorry, I'm new to this forum and programming in general. I edited this post with all my questions regarding this project

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.