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

Native-MIDI seems to be missing some MIDI commands sent #941

Open
batata004 opened this issue Apr 30, 2023 · 2 comments
Open

Native-MIDI seems to be missing some MIDI commands sent #941

batata004 opened this issue Apr 30, 2023 · 2 comments

Comments

@batata004
Copy link

Hi,

I am using Native-MIDI to read MIDI commands. It seems to work fine, when I connect my smartphone to a midi controller, I can see that the smartphone is receiving all the keys I press in my midi controller.

However, when I send keys too fast, the android app (using the sample code provided in the github) is missing many commands. The strange thing is that when I tested most apps of the PlayStore that allows receiving MIDI, all of them work flawlesly, they dont miss any MIDI command.

Maybe they are using other library? I dont know, that's why I ask you: is there any other library the allows me to received MIDI events in a very low latency mode and that misses the least number of commands when they are sent too fast? Or this NDK library is the best one? If so, why is the example code provided in the ndk/native-midi missing MIDI commands?

@as-4096
Copy link

as-4096 commented Oct 28, 2023

I found that in the code for reading MIDI signals, there was no handling of the length of the received data. When very fast note signals are received, there is a phenomenon of sticking together, where multiple notes are included in one output. However, the current code only takes the first note. It should loop through and process all the note messages received. I have already fixed this issue locally and applied it to my app.

@DanAlbert
Copy link
Member

If someone could upload a PR, I'd be grateful. I don't have a midi controller so there isn't a whole lot I can do here.

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