Hi, i'm newbie and sorry for my english,
i'm just interest to create USB midi controller i'm success to program it to single Note change, Control Change, and program change one a time with change code and upload
how can i do a multi function change (like to change mode with holding switch) to let same switch can function other mode without re-code re-upload
i use some code like below,
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
}
void loop() {
button0.update();
button1.update();
button2.update();
button3.update();
button4.update();
button5.update();
//Send control change
if (button0.fallingEdge()) {
usbMIDI.sendControlChange(3, 127, channel); //cc03
}
if (button1.fallingEdge()) {
usbMIDI.sendControlChange(4, 127, channel); //cc04
}
if (button2.fallingEdge()) {
usbMIDI.sendControlChange(5, 127, channel); //cc05
}
if (button3.fallingEdge()) {
usbMIDI.sendControlChange(6, 127, channel); //cc06
}
if (button4.fallingEdge()) {
usbMIDI.sendControlChange(7, 127, channel); //cc06
}
if (button5.fallingEdge()) {
usbMIDI.sendControlChange(8, 127, channel); //cc06
}
// Reset button
if (button0.risingEdge()) {
usbMIDI.sendControlChange(3, 0, channel); //cc03
}
if (button1.risingEdge()) {
usbMIDI.sendControlChange(4, 0, channel); //cc04
}
if (button2.risingEdge()) {
usbMIDI.sendControlChange(5, 0, channel); //cc05
}
if (button3.risingEdge()) {
usbMIDI.sendControlChange(6, 0, channel); //cc06
}
if (button4.risingEdge()) {
usbMIDI.sendControlChange(7, 0, channel); //cc06
}
if (button5.risingEdge()) {
usbMIDI.sendControlChange(8, 0, channel); //cc06
}
while (usbMIDI.read()) {
// ignore incoming messages
}
}
please I need some advice here.