I am new to the coding world and have been trying to learn as much as I can but I have been working on a project on and off for over a year now and I need some help.
I have made a usbMidi note controller. It works very well but I would like to add banks to this pedal.. In example I would have 8 buttons, 7 buttons would have a midi note assigned to them (1,2,3,4,5,6,7). I would like for button number 8 to scroll up through the different banks so that the 7 buttons would have different notes in the different banks. Bank 1 (1,2,3,4,5,6,7). Bank 2 (11,22,33,44,55,66,77) ext.
I have spent hours looking into the different ways of doing this and have accomplished nothing but confusing myself. I have looked deeply into 2D arrays but don't really understand it. Below is a sample code of what I already have that does work. any and all help is very much appreciated.
#include <Bounce.h>
#include <SoftwareSerial.h>
#define txPin 1
const int channel = 1;
Bounce button14 = Bounce(14, 100);
Bounce button15 = Bounce(15, 100);
void setup(){
pinMode(14, INPUT_PULLUP);
pinMode(15, INPUT_PULLUP);
}
void loop(){
button14.update();
button15.update();
if (button14.fallingEdge()) {
usbMIDI.sendNoteOn(24, 99, channel); // 24 = C
}
if (button15.fallingEdge()) {
usbMIDI.sendNoteOn(29, 99, channel);
}
if (button14.risingEdge()) {
usbMIDI.sendNoteOff(24, 0, channel); // 24 = C
}
if (button15.risingEdge()) {
usbMIDI.sendNoteOff(25, 0, channel); // 25 = C#
}