You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue when using this library, primarily when processing a lot of midi messages in a short time (read: going back and forth on all piano keys in my midi controller).
After implementing midi handling manually using plain old Javascript I noticed I ran int the same issue. After reading through the Web MIDI API documentation I noticed something interesting in their examples:
See this issue for more details
nicorobo#20
TL;DR: some midi instruments send a "note on" message with velocity zero instead of "note off" messages. Prior to this change, the `useMidiNotes` hook would never remove notes from the list when using these instruments. Now those instruments work like other ones.
Context
I ran into an issue when using this library, primarily when processing a lot of midi messages in a short time (read: going back and forth on all piano keys in my midi controller).
After implementing midi handling manually using plain old Javascript I noticed I ran int the same issue. After reading through the Web MIDI API documentation I noticed something interesting in their examples:
source: https://webaudio.github.io/web-midi-api/#a-simple-monophonic-sine-wave-midi-synthesizer
turns out we have to
fall through
when the velocity of a note is 0. This is currently missing in theuseConnectInput
hook from what I could see:https://github.com/nickroberts404/react-midi-hooks/blob/master/src/use-connect-input.ts#L33L50
thought I'd bring it to your attention so you can fix it 🙂
The text was updated successfully, but these errors were encountered: