MIDI Note On/Off Messages

Your code is constantly detecting the state of each button and always sending a MIDI message. Instead, you should be looking for a change of state (on to off, or off to on). For each button, save the state. When reading the state, compare it to the value last time the loop and only send a MIDI message if the value has changed. Then set the saved state to the current reading.