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

[BUG] MT4 to USB MIDI 1.0 message conversion issue. #328

Closed
m-komo opened this issue Apr 30, 2024 · 10 comments · Fixed by #358
Closed

[BUG] MT4 to USB MIDI 1.0 message conversion issue. #328

m-komo opened this issue Apr 30, 2024 · 10 comments · Fixed by #358
Assignees
Labels
area-service-or-api 🖥️ Related to the Windows Service, core API, abstractions, etc. bug 🐞 Something isn't working critical ‼️ Critical to be fixed/implemented before next major release dp7-fixed 🥳 Fixed in developer preview 7

Comments

@m-komo
Copy link
Collaborator

m-komo commented Apr 30, 2024

Describe the bug
MT4 messages sent to USB MIDI 1.0 devices that work with the USB MIDI 2.0 driver have several message conversion issues.

  1. Note On/Off velocity value is always zero.
    image

  2. RPN/NRPN Data Entry value converted to 14bits value is incorrect.
    image

To Reproduce

  1. Set the Roland UM-ONE mk2 to class-compliant mode and short INPUPT and OUTPUT to loop back messages.
  2. Attach the UM-ONE to PC.
  3. Update the driver to the USB MIDI 2.0 driver (UsbMidi2.sys).
  4. Open midi.exe in two windows.
  5. From one, monitor UM-ONE.
  6. From the other, send following messages to UM-ONE.
0x40804000 0x02000000
0x40904000 0xFFFF0000
0x40201357 0x55555555
0x40302468 0xCDCDCDCD
  1. Verify received messages.

Installer Name or Version

  • Service: [interim preview build] Windows MIDI Services Developer Preview 6 1.0.24110.1753-x64.exe
  • Driver: Updated_USBMIDI2_10.0.1.4.zip (DP5)

Desktop (please complete the following information):

  • OS: Windows 11
  • OS Build: 26200.5001

Device information, if this is with an external MIDI device:

  • Device: Roland UM-ONE mk2 (Any USB MIDI 1.0 device)
@m-komo m-komo added the bug 🐞 Something isn't working label Apr 30, 2024
@Psychlist1972
Copy link
Contributor

Thank you for this test and report.

@Psychlist1972 Psychlist1972 added the area-service-or-api 🖥️ Related to the Windows Service, core API, abstractions, etc. label May 1, 2024
@Psychlist1972
Copy link
Contributor

On this one, the MIDI 1.0 velocity will need to be 7 bits, not 8.

09 90 40 FF should actually be 09 90 40 7F

In either case, 00 is not correct, but it shouldn't be FF

@m-komo
Copy link
Collaborator Author

m-komo commented May 2, 2024

In either case, 00 is not correct, but it shouldn't be FF

Yes, it was my miswriting.
Thank you.

@Psychlist1972
Copy link
Contributor

Found a casting bug which caused the FFFF to become zero. Thanks.

Psychlist1972 added a commit that referenced this issue May 2, 2024
Fix a couple bugs reported in issue #328
@Psychlist1972
Copy link
Contributor

Also: Velocity 0 for Note off (0x8) is valid. It's only the Note On message (0x9) where a 0 velocity in MIDI 2.0 protocol is translated to 1 when in MIDI 1.0 protocol.

@Psychlist1972 Psychlist1972 added dp6-fixed 🥳 Fixed/implemented in Developer Preview 6 critical ‼️ Critical to be fixed/implemented before next major release labels May 22, 2024
@m-komo
Copy link
Collaborator Author

m-komo commented Jul 18, 2024

Hmm, there is still something wrong with the translator.

First, I would like to make sure the expected result.
Following is the expected result based on my understanding.
image

Is this right?

If so, Note ON velocity and Data Entry seem not translated correctly.
image

I sent Test328.txt to verify.

  • Service: Windows.MIDI.Services.In-Box.Service.-.Developer.Preview.6.1.0.24194.2233-x64.exe
  • Driver: [interim preview build] 240713-USBMidi2-x86-TESTSIGNED.zip (DriverVer = 07/13/2024,23.1.50.504)
  • OS: Windows 11 24H2 (OS Build 26100.1150)

@Psychlist1972
Copy link
Contributor

Looking into this.

@Psychlist1972 Psychlist1972 reopened this Jul 18, 2024
@Psychlist1972
Copy link
Contributor

Psychlist1972 commented Jul 22, 2024

Verified this works with DP7.

Results sending Test328.txt to a MIDI 1.0 hardware loopback

image

The only difference is the 0 vs 1 for velocity in the first message. I see Andrew's libmidi2 translates the Note Off with zero velocity to Note off with 1 velocity, like it does for note on.

Edit: Actually, that's the down-scaling of the 0x0200 velocity in the second MT4 word of the note off message, which also happens to be the example in the spec. "MIDI Velocity = 0x01: translates to 0x0200"

0x40804000 0x02000000
0x40904000 0xFFFF0000
0x40201357 0x55555555
0x40302468 0xCDCDCDCD

@Psychlist1972 Psychlist1972 added dp7-fixed 🥳 Fixed in developer preview 7 and removed dp6-fixed 🥳 Fixed/implemented in Developer Preview 6 labels Jul 22, 2024
@m-komo
Copy link
Collaborator Author

m-komo commented Jul 23, 2024

Edit: Actually, that's the down-scaling of the 0x0200 velocity in the second MT4 word of the note off message, which also happens to be the example in the spec. "MIDI Velocity = 0x01: translates to 0x0200"

My apologies, the table I shared should be as below:

image

@Psychlist1972
Copy link
Contributor

Closed with release of DP7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-service-or-api 🖥️ Related to the Windows Service, core API, abstractions, etc. bug 🐞 Something isn't working critical ‼️ Critical to be fixed/implemented before next major release dp7-fixed 🥳 Fixed in developer preview 7
Projects
Status: 💻 Complete
Development

Successfully merging a pull request may close this issue.

2 participants