 bool keyState[sizeof(keyMidiCons) / sizeof(byte)]; //State of the key.
 bool buttonState[buttonColumns*buttonRows]; //State of the buttons.
 bool padState[padRows*padColumns]; //State of the pad buttons.
+bool lastPadState[padRows*padColumns]; //Previous State of the pad buttons.
 bool rowsRead [keyRows+buttonRows]; // Rows shift in values.
 byte trans = 0; //Level to transpose the octaves.
+byte padPage = 0; //Drum Rack pad page from 0 to 8;
 static byte  keyMidi[sizeof(keyMidiCons) / sizeof(byte)]; 
 byte analogValue[(sizeof(muxEn) / sizeof(byte)) * 8]; 
 //**************************************************************//

      buttonIndex++;
    }
  }
}

/**

 * Method to read all the values of the buttons and send the notes through MIDI.
 */
void readButtons(){
#ifdef debug
  Serial.println("Pad read start");;
#endif
  byte buttonIndex = 0;
  for (byte i = keyColumns; i < buttonColumns+keyColumns; i++) {//Is done like this for the shift register index.
    shiftToColumn(i);
