keijiro / MidiJack

MIDI input plugin for Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Message loss on low frame rate

Dimavj opened this issue · comments

Hi Keijiro!
I'm launching several particle systems and objects in unity, and have programmed disable/enable toggles with midi notes.
In the Editor it runs almost right, but it forgives some notes ... but in build, there's no notes arround entering my scene.
in Editor I can see notes in your midiJack Window, but when they call some debug.log ... it appears only in some of the hits of my midi touch-osc controller.

So, There's some strategy to give more 'presence' to our notes? or rate?... I see the application too busy in launching particles than listening to midinotes...

Well, thanks for help!
Albert.

Hi Again...
I just "SOLVED" it by listening 5 times in the same update function for the notes...
I think is not the best solution but, it goes acceptable for me.
thanks.

Did you close Unity Editor before running the build? Unity Editor should be closed before running the standalone build because MIDI devices are exclusively retained by a single application on some systems.

Hi,
Yes I've closed the editor sure...
Thanks

Thanks for confirming.

Although I've never experienced such a situation, it could happen when the frame rate is quite low. You can use delegates to avoid this kind of message-loss issue. See the example for further details.

https://github.com/keijiro/MidiJack/blob/master/Assets/Example%20Delegate/DelegateTester.cs

Yes, I've beeing re-testing it right now, and it occurs again.
Thank you very much for the answer!
Well, I'm not famirliarized with delegates, I'll look for some tut or explaination to learn how to use it, so, have you some suggestion?
Cheers.
Albert

Hi Keijiro,
Finally I've learned how to use your delegate's functions from your example.
It's all going on
Thank you a lot for your work on MidiJack, is a useful, simple, and complete tool
I'm closing the thread,
Cheers.
Albert.

The original problem hasn't been solved yet. Please keep this ticket opened.

Hi Keijiro,
This script sometimes misses MIDI input and can not be controlled reliably in the update function.
Although using delegate will work good.

Is there a technique to reliably receive MIDI signals with GetKeyDown Function?
Best regards,

commented

For me the GetKeyDown function also misses a lot of notes and i am a total beginner in C# idk how to use delegate =,o its all too complicated =p

I'm also finding that down notes are occasionally skipped. Seems they aren't registered during DequeueIncomingData. Could you share how this data stream works? Might higher frame rates help?