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 the useConnectInput 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 🙂
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 throughwhen the velocity of a note is 0. This is currently missing in theuseConnectInputhook 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 🙂