keypad.h como controlador midi

olá amigos !! venho pedir uma ajuda a voces com essa biblioteca, estou meio confuso com ela, lembrando que meu conhecimento em programação e bem básica então vamos lá,tenho uma matriz de teclado musical estou querendo usar como um controlador mid, consegui fazer funcionar com o exemplo event key da propia biblioteca mas..., este exemplo nao permiti o acionamento de varias teclas,dai então dei uma olhada no exemplo multkey que permite o acionamento de varias teclas mas ao chamar o caracterer nao tenho nada na porta tx, segue o esbolço

#include <MIDI.h>
#include <Keypad.h>

const byte ROWS = 12; 
const byte COLS = 6; 
char keys[ROWS][COLS] = {
 {0,1,2,3,4,5},
 {6,7,8,9,10,11},
 {12,13,14,15,16,17},
 {18,19,20,21,22,23},
 {24,25,26,27,28,29},
 {30,31,32,33,34,35},
 {36,37,38,39,40,41},
 {42,43,44,45,46,47},
 {48,49,50,51,52,53},
 {54,55,56,57,58,59},
 {60,61,62,63,64,65},
 {66,67,68,69,70,71}
};
byte rowPins[ROWS] = {13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2};
byte colPins[COLS] = {18, 19, 17, 16, 15, 14}; 

Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
MIDI_CREATE_INSTANCE(HardwareSerial,Serial, midiOut);

unsigned long loopCount;
unsigned long startTime;



void setup() {
    Serial.begin(9600);
    loopCount = 0;
    startTime = millis();

}


void loop() {
    loopCount++;
    if ( (millis()-startTime)>5000 ) {
        startTime = millis();
        loopCount = 0; }


    if (kpd.getKeys())
    {
        for (int i=0; i<LIST_MAX; i++)   
        {
            if ( kpd.key[i].stateChanged )   
                switch (kpd.key[i].kstate) { 
                    
                    case PRESSED:
                   if (Key == 12) {midiOut.sendNoteOn(36,40,1);}
                   
                break;
                
                    case RELEASED:
                   if (Key == 12) {midiOut.sendNoteOff(36,40,1);}
                break;

                }
        }
    }
}

Ola jeferssonsalvatory, também sou um novato neste universo de Arduino, porém consegui fazer um antigo CASIO funcionar através de um código similar ao seu, documentei meus passos neste post.

De qualquer forma tente colocar sua matriz no código que eu utilizeim nele eu consigo pressionar mais de uma tecla ao mesmo tempo e obter som.

Abraços.

#include <MIDI.h>
#include <Keypad.h>

const byte ROWS = 8; // 8 Linhas
const byte COLS = 8; // 8 Colunas
 
char keys[COLS][ROWS] = {
  {36, 37, 38, 39, 40, 41, 42, 43},
  {44, 45, 46, 47, 48, 49, 50, 51},
  {52, 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, 85, 86, 87, 88, 89, 90, 91},
  {92, 93, 94, 95, 96, 97, 98, 99}
};
 
byte rowPins[ROWS] = {22, 26, 30, 34, 38, 42, 46, 50}; //connect to the row pinouts of the kpd
byte colPins[COLS] = {A0, A2, A4, A6, A8, A10, A12, A14}; //connect to the column pinouts of the kpd

Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

byte pressed = 32;
byte chanel = 0; // MIDI channel to use

void setup() {
 Serial.begin(115200); // set this the same as Hairless
}


void loop() {
 // Fills kpd.key[49] array with up-to 10 active keys.
 // Returns true if there are ANY active keys.
 if (kpd.getKeys())
 {
   for (int i = 0; i < LIST_MAX; i++) // Scan the whole key list.
   {
     if ( kpd.key[i].stateChanged )   // Only find keys that have changed state.
     {
       pressed = kpd.key[i].kchar + 12;
       switch (kpd.key[i].kstate) {  // Report active key state : IDLE, PRESSED, HOLD, or RELEASED
         case PRESSED:
           sendMIDI(chanel | 0x90, pressed, 100);
           break;
          case RELEASED:
           sendMIDI(chanel | 0x80, pressed, 64);
           break;
       }
     }
   }
 }
}  // End loop

void sendMIDI(byte type, byte note, byte velocity){
  Serial.write(type);
  Serial.write(note & 0x7F);
  Serial.write(velocity);
}