A lot of incoming midi messeges cause synth

Do you see the flood playing out on the display?

I don't use the keypad library, but I can ask why you don't use it in the simple way the example code does, viz:

void loop(){
  char key = keypad.getKey();
  
  if (key){
    Serial.println(key);
  }
}

Where obvsly I hope you'd want to handle the pressed key differently to just serial printing it.

Looping over all the keys just to find one you pressed makes sense if you are trying to see multiple keys get pressed at the same instant.

a7