works: MIDI-IN: code + schematics

hi tep,
probably your keyboard sends "Note ON w ZERO velocity" instead of "NOTE off". the ones i tested do this.

best, kuk