Hi, i'm designing a midi controller which involves a button matrix, and since i need to use the pressed and released states from every button, i chose to use the keypad.h library, after using the MultiKey example adapted to my code, it does something like it "adds up" the midi note number as i keep pressing more buttons:

(Here i pressed button 1, 2 and 3 and leave them pressed as i start pressing the rest, and release all at once)
I was expecting being able to press button 1 and send note 0, button 2 and send note 1 and so on (and being able to do that while i'm pressing other buttons), but it's not happening, am i missing something here?
Code used in this part:
void keyread()
{
if(keyb.getKeys()==1)
{
for(int i=0; i<LIST_MAX; i++)
{
if(keyb.key[i].stateChanged) // Only find keys that have changed state.
{
switch(keyb.key[i].kstate)
{
case PRESSED:
sendnote(i, 127);
break;
case IDLE:
sendnote(i, 0);
break;
}
}
}
}
}
(sendnote(Note, Velocity) involves using 127 as a "NoteON" command to the "i" note number, and 0 as a "NoteOFF" command.)
(the rest of the code is working flawlessly)