Giter Club home page Giter Club logo

Comments (26)

melanchall avatar melanchall commented on July 19, 2024 1

Pretty strange... Hm, it looks like we need to write some code in C in XCode. I'll try to provide you the code tomorrow.

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024 1

Hi James,

Thank you a lot! Now I know for sure what's going on. Your message was split into multiple separate messages. DryWetMIDI right now assumes that single packet == single complete message. Which is obviously wrong according to your tests.

It's definitely the bug in my library. It should be pretty easy to fix, but I think I can handle it in next year only (I'm going to vacation right now :)).

I appreciate your assistance with diagnosing the problem. Thanks!

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024 1

Hi James,

Great! Thanks for the issue and your assistance! You've made the library better.

Thanks,
Max

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Hi James,

Yes, I definitely need more information:

  1. Can you please check this sysex message receiving by any other MIDI software? Is it OK?
  2. Does the problem occur only with this specific 251-byte sysex message or with any sysex one?
  3. Can you please provide bytes of the message so I can try to reproduce the error within my unit tests?

Also please be patient, I'm not a macOS user, so you can be asked a lot of questions by me to clarify what's going on :)

Thanks,
Max

from drywetmidi.

James-Morrell avatar James-Morrell commented on July 19, 2024

Hi Max,

Thanks for the quick response, here are my answers:

  1. It works fine in other midi software including SysEx Librarian & MidiView
  2. I'll check this next, will post a response asap.
  3. Here are the bytes in Hex format:
    00 21 5F 00 00 01 03 01 01 06 00 00 02 00 00 4C 00 00 41 00 00 52 00 00 49 00 00 20 00 00 42 00 00 20 00 00 53 00 00 4F 00 00 4C 00 00 4F 00 00 20 00 00 20 00 00 20 00 00 20 00 00 20 00 00 02 00 00 3D 04 00 00 00 00 74 03 00 64 00 00 74 03 00 00 00 00 74 03 00 64 00 00 01 00 00 1C 00 00 00 00 00 00 00 00 7F 7F 03 05 00 00 64 00 00 7F 7F 03 05 00 00 64 00 00 7F 7F 03 05 00 00 64 00 00 00 00 00 3C 00 00 00 00 00 00 00 00 64 00 00 64 00 00 64 00 00 64 00 00 00 00 00 00 00 00 2C 02 00 14 00 00 28 00 00 3C 00 00 64 00 00 64 00 00 64 00 00 00 00 00 6C 7F 03 6C 7F 03 04 00 00 0A 00 00 00 00 00 7F 7F 03 01 00 00 48 01 00 00 00 00 6C 7F 03 7F 7F 03 04 00 00 7F 7F 03 00 00 00 7F 7F 03 01 00 00 48 01 00 00 00 00 30 7F 03 14 00 00 48 01 00 00 00 00 F7

Feel free to ask me anymore questions I will try to help get this issue solved.
James

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Regarding bytes: are you sure thare is no F0 byte at the start of the message?

from drywetmidi.

James-Morrell avatar James-Morrell commented on July 19, 2024

Sorry, there is a F0 at the start of the message. Just that SysExEvent.Data's print has truncated it.

I've just tried this with another device and send a variety of SysEx messages, and it seems to do the same.
The simplest one which displays the issues is:
F0 7F 60 40 F7

Thanks
James

from drywetmidi.

James-Morrell avatar James-Morrell commented on July 19, 2024

Just as an update, the sysEx messages are fine with 2 bytes or less.

I've just tried another API using RtMidi on mac os, and that works:
RtMidi.Core

Maybe that can be some help for reference?

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Thanks! I'll look into it tomorrow.

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Well, I've created unit tests with the provided bytes arrays. Running them on virtual machine with Monterey 12.6.1 ends with success, sysex events are received correctly. So we need to do some tests on your machine.

I've prepared the archive: TestKit.zip. Unzip it please somewhere on your computer.


First of all, run the LoopbackDevice program from the folder in a separate Terminal window:

./LoopbackDevice "MIDI A" "MIDI B" "MIDI C"

This commad will create three virtual loopback devices. Devices are present in the system as long as the program running, so please don't close the Terminal.


Now let's open the SendDataViaDwm.sln solution in IDE (VS for Mac or Rider) and run it. We expect to see the message that sysex F0 7F 60 40 F7 is received. Please write me if bytes are correct in the message (F0 will be omitted).


Then let's open the SendDataViaBytes.sln solution in IDE (VS for Mac or Rider) and run it. We expect to see the message that sysex F0 7F 60 40 F7 is received. Please write me if bytes are correct in the message (F0 will be omitted).

from drywetmidi.

James-Morrell avatar James-Morrell commented on July 19, 2024

Hi Max,

Just ran the test's on the Mac device I have, The "SendDataViaDwm.sln" worked correctly. But the "SendDataViaBytes.sln" did not. I received no message with the "SendDataViaBytes.sln" and only the Press any key to exit... displayed.

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Thanks James!

Well, I'll try to provide new version of the SendDataViaBytes to try to understand why it's not working. For now, can you please confirm that you see wrong data with SendDataViaDwm if you send sysex via your device the problem occurred with?

from drywetmidi.

James-Morrell avatar James-Morrell commented on July 19, 2024

Just checked SendDataViaDwm with two different MIDI USB devices, I sent the SysEx from my windows machine.
With both devices it only shows the first two bytes 7F 60. On the loopback it is fine.

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Hi James,

I've prepared a new solution: ViewPacketsData.zip. Replace name of the device with the desired one from where you receive broken data:

InputDevice.GetByName("MIDI A");

Just follow the instructions from the utility and provide me an output text please. I made the solution without any tests so please write me about any errors if any.

from drywetmidi.

James-Morrell avatar James-Morrell commented on July 19, 2024

Hi Max,

I've just run the ViewPacketsData, here's the output from the terminal:

Packet 0 / 1 data:
    F0 0 21
Packet 0 / 1 data:
    5F 0 0
Packet 0 / 1 data:
    1 3 1 1 6 0
Packet 0 / 1 data:
    0 0 0
Packet 0 / 1 data:
    0 4C 0 0 41 0 0 52 0 0 49 0 0 20 0 0 42 0 0 20 0 0 38 0 0 54 0 0 48 0 0 20 0 0 4E 0 0 4F 0 0 54 0 0 45 0 0 20 0
Packet 0 / 1 data:
    0 1 0 0 F 2 0 0 0 0 74 3 0 64 0 0 74 3 0 0 0 0 74 3 0 64 0 0 1 0
Packet 0 / 1 data:
    0 18 0 0 1E 0 0 1C 0 0 7F 7F 3 28 0
Packet 0 / 1 data:
    0 64 0 0 7F 7F
Packet 0 / 1 data:
    3 5 0
Packet 0 / 1 data:
    0 64 0
Packet 0 / 1 data:
    0 7F 7F
Packet 0 / 1 data:
    3 5 0
Packet 0 / 1 data:
    0 64 0
Packet 0 / 1 data:
    0 0 0
Packet 0 / 1 data:
    0 2C 0 0 1 0 0 0 0 0 64 0 0 64 0 0 64 0 0 64 0 0 0 0 0 0 0 0 2C 2 0 14 0 0 28 0 0 3C 0 0 64 0 0 64 0 0 64 0
Packet 0 / 1 data:
    0 0 0 0 6C 7F 3 6C 7F 3 4 0 0 A 0 0 0 0 0 7F 7F 3 1 0 0 48 1 0 0 0 0 6C 7F 3 7F 7F 3 4 0 0 7F 7F 3 0 0 0 7F 7F
Packet 0 / 1 data:
    3 1 0 0 48 1 0 0 0 0 30 7F 3 14 0
Packet 0 / 1 data:
    0 48 1
Packet 0 / 1 data:
    0 0 0
Packet 0 / 1 data:
    0 F7

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Hi James,

Is that output on sending one single event or multiple ones? If multiple, can you please just send a single one (for example, F0 7F 60 40 F7)?

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Can you please run a new version of the solution: ViewPacketsData.zip? I have an assumption what's going on.

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

@James-Morrell Any news?

from drywetmidi.

James-Morrell avatar James-Morrell commented on July 19, 2024

Hi Max,

Sorry I've been away for a couple of days, will look at it some point today :)

James

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Hi James,

Here another one new version: ViewPacketsData.zip :)

from drywetmidi.

James-Morrell avatar James-Morrell commented on July 19, 2024

Hi @melanchall

Here's the output for the latest ViewPacketsData.zip

Waiting for packets information...
Just send problem sysex and wait some time, then just press any key to see the log
 Message received at [2022-12-16T14:47:01.2838960Z]!
Packet 0 / 1 data:
    F0 00 21
Message received at [2022-12-16T14:47:01.3909050Z]!
Packet 0 / 1 data:
    5F 00 00
Message received at [2022-12-16T14:47:01.3910180Z]!
Packet 0 / 1 data:
    01 03 01 01 06 00 00 00 00 00 4C 00 00 41 00 00 52 00
Message received at [2022-12-16T14:47:01.3911710Z]!
Packet 0 / 1 data:
    00 49 00 00 20 00
Message received at [2022-12-16T14:47:01.3912260Z]!
Packet 0 / 1 data:
    00 42 00 00 20 00 00 38 00 00 54 00 00 48 00 00 20 00 00 4E 00 00 4F 00 00 54 00 00 45 00 00 20 00 00 01 00 00 0F 02 00 00 00 00 74 03 00 64 00
Message received at [2022-12-16T14:47:01.3912940Z]!
Packet 0 / 1 data:
    00 74 03 00 00 00 00 74 03 00 64 00 00 01 00 00 18 00 00 1E 00 00 1C 00 00 7F 7F 03 28 00 00 64 00 00 7F 7F 03 05 00 00 64 00 00 7F 7F
Message received at [2022-12-16T14:47:01.4502970Z]!
Packet 0 / 1 data:
    03 05 00
Message received at [2022-12-16T14:47:01.4503970Z]!
Packet 0 / 1 data:
    00 64 00
Message received at [2022-12-16T14:47:01.4505440Z]!
Packet 0 / 1 data:
    00 00 00
Message received at [2022-12-16T14:47:01.4506370Z]!
Packet 0 / 1 data:
    00 2C 00 00 01 00 00 00 00 00 64 00 00 64 00 00 64 00 00 64 00 00 00 00 00 00 00 00 2C 02 00 14 00 00 28 00 00 3C 00 00 64 00 00 64 00 00 64 00
Message received at [2022-12-16T14:47:01.4507270Z]!
Packet 0 / 1 data:
    00 00 00 00 6C 7F 03 6C 7F 03 04 00 00 0A 00 00 00 00 00 7F 7F 03 01 00 00 48 01 00 00 00 00 6C 7F 03 7F 7F 03 04 00 00 7F 7F 03 00 00 00 7F 7F
Message received at [2022-12-16T14:47:01.4507960Z]!
Packet 0 / 1 data:
    03 01 00 00 48 01 00 00 00 00 30 7F 03 14 00
Message received at [2022-12-16T14:47:01.4558240Z]!
Packet 0 / 1 data:
    00 48 01
Message received at [2022-12-16T14:47:01.4559230Z]!
Packet 0 / 1 data:
    00 00 00
Message received at [2022-12-16T14:47:01.4560460Z]!
Packet 0 / 1 data:
    00 F7
 
Press any key to exit...

Do you want the other output from the previous version, it is the same but without the time stamps.

James

from drywetmidi.

James-Morrell avatar James-Morrell commented on July 19, 2024

Hi Max,
Glad I could help, let me know if you need anymore tests this end!

Have a good holiday!
James

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Thanks James! If I'll be able to fix the bug before next year, I definitely let you know.

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

Hi James,

Looks like the bug has been fixed now according to my unit tests. I've published new prerelease version of the library - 6.1.4-prerelease2. @James-Morrell Can you please install it into your project and let me know whether the problem is gone or not?

Thanks,
Max

from drywetmidi.

James-Morrell avatar James-Morrell commented on July 19, 2024

Hi Max,

Sorry for the late response, been away for the holidays!

Just tested 6.1.4-prerelease2 and it's all working!

Kind regards,
James

from drywetmidi.

melanchall avatar melanchall commented on July 19, 2024

🚀 6.1.4 version is released now!

Prerelease NuGet packages will be unlisted soon, so please update the package references to the new version.

Thanks for using the library!

from drywetmidi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.