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

Is the reserved area handled correctly when generating a MUID? #14

Open
RyoSusami opened this issue Sep 12, 2024 · 1 comment
Open

Is the reserved area handled correctly when generating a MUID? #14

RyoSusami opened this issue Sep 12, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@RyoSusami
Copy link

sendDiscovery() in /libs/midici.js
this._muid = getRandomInt(0xFFFFF00);

getRandomInt() in /libs/utils.js
return Math.floor(Math.random() * Math.floor(max+1));

Does this mean the generated value will include 0x0FFFFF00 ?

On the other hand, the specifications...
https://amei.or.jp/midistandardcommittee/MIDI2.0/MIDI2.0-DOCS/M2-101-UM_v1-2_MIDI-CI_Specification.pdf
3.3 MIDI-CI MUID
The values 0x0FFFFF00 to 0x0FFFFFFE are reserved.

0x0FFFFF00 looks like it should not be used.

Please ignore if I misunderstood. Thank you.

@starfishmod
Copy link
Member

@RyoSusami yes you are correct. It should be
getRandomInt(0xFFFFEFF) <-- One less than what it was.
Granted the chances of it ever getting 0xFFFFF00 is very very very rare :)

I'll add a fix in the next release - thanks!

@starfishmod starfishmod added bug Something isn't working good first issue Good for newcomers labels Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants