Trying to set up and old casio keyboard as a midi controller
Using the keypad library to map the keys to functions
Need help in making the keys into midi out messages
Total beginner and hvent had much luck in figuring out how to go about it
Using arduino uno r3
here is the current code
please guide on how to make the above mentioned happen
any help would be appreciated
#include <Keypad.h>
const byte ROWS = 4; //four rows
const byte COLS = 8; //eight columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{'53','54','55','56','57','58','59','60'},
{'61','62','63','64','65','66','67','68'},
{'69','70','71','72','73','74','75','76'},
{'77','78','79','80','81','82','83','84'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {13, 12, 11, 10, 9, 8, 7, 6}; //connect to the column pinouts of the keypad
//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
//int notes[] = {
// a, b, c, d, e, f, g, h, i, k, l, m, n, o, p ,q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F
//};
void setup(){
Serial.begin(9600);
}
void loop(){
int note = customKeypad.getKey();
//for(int customKey = "a" ; customKey = "F" ; customKey++) {
if (note !=NO_KEY){
Serial.println(note);
}
}
void noteOn(int cmd, int pitch, int velocity) {
Serial.write(cmd);
Serial.write(pitch);
Serial.write(velocity);
}