WebAudio / web-midi-api

The Web MIDI API, developed by the W3C Audio WG
http://webaudio.github.io/web-midi-api/
Other
323 stars 49 forks source link

Ordering of messages scheduled at the exact same time #212

Open djipco opened 4 years ago

djipco commented 4 years ago

It might be a good idea to specify the order in which messages scheduled for the exact same timestamp are sent.

I stumbled into a situation with JazzSoft's implementation of requestMidiAccess where control change messages intended to select an NRPN parameter are sent out of order.

This is what I am doing:

send([ 176, 99, 12 ], 5000);
send([ 176, 98, 34 ], 5000);

But the message are (sometimes) received in this order:

[ 176, 98, 34 ]
[ 176, 99, 12 ]

I believe messages scheduled for the exact same timestamp should be sent in the order they were originally queued. The spec should probably explicitly mention that.

Does that make sense?

toyoshim commented 3 years ago

I think Chrome just receive the message as it was received at the OS layer. So, if this is just an editorial issue, I'm fine with clarifying this in the spec, as the message should appear in the order the system actually received