la-jarre-a-son / midi-jar

MIDI Jar is a tool box for musicians, learners, streamers, that want to route MIDI message between devices, and display a piano or chords while playing, and integrate it on a video or on a Twitch stream.
http://midi-jar.ljas.fr/
MIT License
87 stars 9 forks source link

Malfunction with keyboards that send 'Note On' with 0 velocity instead of 'Note Off' #10

Closed Moleman0 closed 2 years ago

Moleman0 commented 2 years ago

Expected Behavior

The notes should go off when releasing the keys.

Current Behavior

The notes show up doubled upon releasing and stay on forever, because the midi message is always Note On.

Capture

Debug log: [58496.5730] Axiom 61 MIDI In: channel 1 - 144:Note On - note 48 - 57 [58667.0615] Axiom 61 MIDI In: channel 1 - 144:Note On - note 48 - 0 [60075.9404] Axiom 61 MIDI In: channel 1 - 144:Note On - note 50 - 57 [60208.6306] Axiom 61 MIDI In: channel 1 - 144:Note On - note 50 - 0 [60919.7518] Axiom 61 MIDI In: channel 1 - 144:Note On - note 52 - 82 [61023.0185] Axiom 61 MIDI In: channel 1 - 144:Note On - note 52 - 0 [64152.0226] Axiom 61 MIDI In: channel 1 - 144:Note On - note 53 - 52 [64264.1501] Axiom 61 MIDI In: channel 1 - 144:Note On - note 53 - 0

Suggested Solution (if any)

The midi message Note On (0x90) should only be considered to be a note on trigger when its velocity is not 0. Also an 0x90 message with 0 velocity should be equivalent to Note Off (0x80).

Unfortunately this setting cannot be changed in my midi keyboard itself.

Your Environment

ArTiSTiX commented 2 years ago

Thanks @Moleman0 for reporting your issue.

Strange behaviour that your keyboard has, but this should be an easy fix. I may work on this soon and provide you an patched version of Midi JAR so you can test it.

Moleman0 commented 2 years ago

Thank you a lot!

(I read that this is a standard midi functionality called "running status", it requires less data down the line. Normally the status byte needs to be sent with each note twice (0x90 down and 0x80 up), but this way it can stay 0x90 and only the note and velocity values need to be transmitted individually.)

mighele commented 2 years ago

Up-vote :) I have this same issue too. Looking forward to a fix. Thanks

ArTiSTiX commented 2 years ago

@Moleman0 @mighele I updated MIDI Jar to 1.2.1 with a fix. I don't have any keyboard using this mode so can you notify me if this works for you so that i can close this issue ?

Thanks !

mighele commented 2 years ago

I've just tried version 1.2.1 and it now works for me. Thanks for the speedy turn around :)

Moleman0 commented 2 years ago

It works perfectly for me as well. Thank you!

ArTiSTiX commented 2 years ago

Thank you & enjoy !