When looking at the microswitch, the left terminal of the LED is the ground. The right terminal is the positive, which comes from a microcontroller pin.
The normally closed connection from the microswitch goes to ground. The normally open connection goes to 5V. The common connection goes to a microcontroller pin.
The switch is de-bounced for 3 milliseconds. Different values will have to be tested.
The LED responds to velocities of any notes on any channels that are non-zero. A note-off event turns the LED off. The button is sent via MIDI note 60, channel 1. Pressed is a note-on with a velocity of 127. De-pressed is a note-off.