BlackPhlox / bevy_midi

Send and receive MIDI data to and from bevy using DAWS or MIDI Controllers
Apache License 2.0
56 stars 10 forks source link

All messages are "Note On", even on release of the key. #33

Open Saskcwatch opened 11 months ago

Saskcwatch commented 11 months ago

Hello, I'm using a M-Audio Keyrig 49 keyboard on Linux. When trying the input example I successfully connect to the key board but every time I press a key it reads as "Note On", even on release. It seems that everytime, the first number in the MIDI message is 144.

Screenshot from 2023-11-07 17-20-42

BlackPhlox commented 11 months ago

Hi Thanks for creating the issue! Was this using the crate version (bevy 0.10) or using main?

BlackPhlox commented 11 months ago

@Saskcwatch Can you confirm that when you release the last element in the raw midi message is 0? Cause then we need to handled that case as well. It is because you keyboard is using a different approach to indicate a key release.

Saskcwatch commented 11 months ago

Hello, First off all I tested it on the example that I got when cloning this repo so I would say main. And secondly I'm almost sure that the last element beeing 0 signifies release. I kinda patched it myself by modifying the is_note_on and is_note_offfunctiuns in lib.rs to return self.msg[2] != 0 and self.msg[2] == 0. But as you said this is something that may only work on my keyboard.