Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity not recognizing Midi Messages properly on MacOS Catalina with Alesis Nitro Mesh Kit #61

Open
Jason-Horn opened this issue Jul 13, 2021 · 4 comments
Assignees
Labels

Comments

@Jason-Horn
Copy link

I'm sending a Unity 2019.4.29 MacOS Build to a colleague with MacOS Catalina 10.15. The Build should be controlled with an electronic drumset, the Alesis Nitro Mesh Mit. It is recognized as a Midi Device, but the Midi Messages that are detected look like this:

s(F8) d(00,00) from 6A39D778

and this message is received multiple times independent from any input on the drumset.

The input itself is not detected by the function MidiMaster.GetKeyDown(notenumber). I'm iterating through all notenumbervalues between 0 and 127, but the return is always false.
When I use a Windows 10 build and a AKAI LPD8 Midi Controller I get the following Midi Message when I play the Notenumber 36 for example:

s(90) d(24,21) from 341BFC90
s(80) d(24,7F) from 341BFC90

The MidiMaster.GetKeyDown(36) returns true.

Does anyone have any suggestions how to approach and solve this problem?
Any help is appreciated.

@keijiro keijiro self-assigned this Jul 14, 2021
@keijiro
Copy link
Owner

keijiro commented Jul 14, 2021

s(F8) d(00,00) from 6A39D778

This seems like a MIDI timing message. You should ignore it.

First of all, could you check if the device is correctly sending MIDI messages? You can use any DAW.

@Jason-Horn
Copy link
Author

Yes you're right thank you! The status F8 Messages are System Real Time Messages that are sent permanently by the drumset.
I was now able to filter them out by only allowing messages with status 9 and 8 to enter the MidiMessage Queue.

But the core problem still exists. The Midi Messages that the drumset sends are s(99) d(xx,xx) for noteOn and s(99) d(xx,00) for noteOff. So it means, they are sent on MidiChannel 10.

When I send a midiMessage on Channel 1 / s(90) ), everything is fine. But when I send the same Message on Channel 10 / s(99), the GetKeyDown()-function (that I run permantently in a Update()-function of a Unity MonoBehaviour Script) gets evaluated too late. Too late means after the update()-function part of the MidiDriver.cs, which decreases the _channelArray._noteArray X-value to a value X<1. Therefore GetKeyDown never returns true, as it never encounters the small period in time, where X>1 is true.

And yes the drumset works in Garage Band.

@Jason-Horn
Copy link
Author

Seems like the problem vanishes if I comment out the updateIfNeeded() part of the getKeyDown()-function. Seems to solve the problem for my use case.

@keijiro
Copy link
Owner

keijiro commented Jul 15, 2021

Good catch. I'd recommend using that solution on your side. I'm not actively maintaining this project any more (because I'm working on a new MIDI plugin called Minis), so DIY is recommended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants