Dears,
I am having a hard time (in a good way
) trying to write a sketch for a keyboard MIDI controller.
What I am trying to do is essentially send MIDI CC's from a 16 potentiometers Arduino - controller to a keyboard that can accept 32 different CC's. When I press the "switch" button, the 16 pots send a new set of CC's (one for each), and revert back to the first set of 16 CC's when I press again the button.
I have the error in subject when trying to compile this:
#include <MIDI.h>
#define MIDI_CHANNEL 1 //the MIDI channel you set your keyboard to listen to (1-16)
// Created and binds the MIDI interface to the default hardware Serial port
MIDI_CREATE_DEFAULT_INSTANCE();
const byte swButton = 2;
boolean switchState;
byte row = 0;
//Define Pots
byte pot[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
byte lastpot[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
//Define cc number for each pot
byte midi_cc[] = {24, 25, 3, 4, 5, 7, 8, 14, 11, 0, 12, 13, 22, 2, 23, 34};
//byte midi_cc[] = {9, 16, 17, 18, 19, 1, 20, 21, 26, 27, 28, 29, 30, 31, 32, 33};
void setup() {
pinMode(swButton, INPUT_PULLUP);
switchState = digitalRead(swButton);
}
void loop(){
if(digitalRead(swButton) != switchState){
 switchState = !switchState;
 if(switchState == LOW){row = !row;}
 if(row == 0){
  midi_cc[] = {24, 25, 3, 4, 5, 7, 8, 14, 11, 0, 12, 13, 22, 2, 23, 34};//page 1
 }
 else {
  midi_cc[] = {9, 16, 17, 18, 19, 1, 20, 21, 26, 27, 28, 29, 30, 31, 32, 33};//page 2
 }
 delay(300);} //cheap debounce
}
Any idea how could I solve this?
Thanks!!