lhl2617 / VSLilyPond

VSCode Extension for LilyPond
https://marketplace.visualstudio.com/items?itemName=lhl2617.vslilypond
90 stars 7 forks source link

Use the MIDI status byte to determine keyDown #342

Closed paradox460 closed 2 years ago

paradox460 commented 2 years ago

The MIDI status byte is present in every MIDI message, and indicates what the message actually is. For a keyDown message, the byte is 0x90.

Many keyboards emit non-zero velocities on key up, and some are even variable based on the key return speed.

This commit changes both the MIDI message processor to only look at messages with a keycode of 0x80 (keyUp) or 0x90 (keyDown), as well as ensuring the previous note range clamp is in effect. It fixes #341.

Furthermore, it fixes a class of issues where other control surface inputs were being captured as notes.

Here is what the output result looks like Screenshot 2021-09-03 at 20 47 03