keijiro / MidiJack

MIDI input plugin for Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NoteOn delegate triggers on actual Note Off

DVonk opened this issue · comments

I've been using a loop over all keys in Update(), but there was some message loss, so I've tried the delegate. But now I have the problem that I get a trigger of NoteOn on an actual Note Off.

When I press a key I get the correct NoteOn event. But when I let go I get the same event, but with 0 velocity. So now I have to check for velocity > 0. Is this intended?

Yes and no.

In the MIDI specification, a note-on message with zero velocity works as note-off. So, I can say that that's a MIDI-compliant behavior.

However, I think that's not a good design choice because most people are not sure about this strange behavior. I should have implemented it in a better way.

I wouldn't like to change this behavior because MidiJack1 is in the end-of-life phase. This kind of issue has been fixed in the latest plugin, Minis.

https://github.com/keijiro/Minis

Oh, I didn't even see your new plugin. I'll try it as soon as possible, thanks!