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

Invalid sendMessage behaviour with multiple messages on MacOs #227

Open
avovetisa opened this issue Aug 30, 2022 · 0 comments
Open

Invalid sendMessage behaviour with multiple messages on MacOs #227

avovetisa opened this issue Aug 30, 2022 · 0 comments

Comments

@avovetisa
Copy link

avovetisa commented Aug 30, 2022

Hi,

On macOS (BigSur, version 11.5.1, with M1 chip, node V16.15 midi V2.0.0), I have the following issue.
When Im sending multiple events with sendMessage, some disappear of seems to be corrupted.

With is the code I use
const noteOnCh10 = 0x99;
const out2 = new midi.Output();
out2.openPort(1);
out2.sendMessage([noteOnCh10, 36, 0x64]);
out2.sendMessage([noteOnCh10, 38, 0x64]);

This is what I receive (with the debug tool Midi Monitor)
12:21:43.895 To USB20MIDI Note On 10 C1 100
12:21:43.895 To USB20MIDI Invalid 3 bytes

With more messages, I can see other invalid or corrupted messages.
If I add a timeout of 3ms between each sendMessage, it solve the issue.

My midi device is a usb-midi to real midi converter, so it is a slow device
My question is : Is the sendMessage method wait that the data sent before to send next data ?

Can we have a promise version of sendMessage that ensure that the message is sent before to send another message ?

Thanks you very much.

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

No branches or pull requests

1 participant