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

Note On with velocity 0 is sent as Note Off on macOS #320

Open
GuruGurra opened this issue Sep 4, 2023 · 9 comments
Open

Note On with velocity 0 is sent as Note Off on macOS #320

GuruGurra opened this issue Sep 4, 2023 · 9 comments

Comments

@GuruGurra
Copy link

The Midi spec says a Note On message with velocity 0 should be treated as a Note Off message. The Mackie Control spec, on the other hand, says that the release of a button should be reported as a Note On message with velocity 0.

When I make a call to send a Note On Message with velocity 0; this is sent as a Note On (90 xx 00) on Windows but is sent as a Note Off (80 xx 40) on macOS.

Some daws have implemented the Mackie Control protocol strictly after the Mackie spec, meaning that they require a Note On/vel 0 message and ignore Note Off messages. My app doesn't work with these daws since the wrong Midi message is sent.

How can I ensure the Note On message is sent as I have defined it on macOS and not translated to a Note Off message?

@insolace
Copy link
Contributor

insolace commented Sep 4, 2023 via email

@GuruGurra
Copy link
Author

I was afraid that would be the answer. :-/

Midi monitor verifies that the sent command is a Note Off (80 xx 40), not the requested Note On (90 xx 00).

I agree that any program that doesn't consider Note Off as a release is buggy. Still, it would have been nice if the messages I specify would have been sent...

@insolace
Copy link
Contributor

insolace commented Sep 5, 2023 via email

@GuruGurra
Copy link
Author

Well, something is modifying the data. I'm using C#, so my calls are going through the RtMidi.Core wrapper.


A call to send a Note On with velocity 1:

NoteOnMessage msg = new NoteOnMessage(RtMidi.Core.Enums.Channel.Channel1, RtMidi.Core.Enums.Key.Key50, 1);
MidiOut.Send(in msg);

When I make this call, the msg buffer contains "90 32 01", and what is sent is "90 32 01".

A call to send a Note On with velocity 0:

NoteOnMessage msg = new NoteOnMessage(RtMidi.Core.Enums.Channel.Channel1, RtMidi.Core.Enums.Key.Key50, 0);
MidiOut.Send(in msg);

When I make this call, the msg buffer contains "90 32 00", and what is sent is "80 32 40". 

On Windows, the correct message is sent; it's only on Mac that it is changed.

@insolace
Copy link
Contributor

insolace commented Sep 5, 2023 via email

@GuruGurra
Copy link
Author

Yes, I am.

RtMidi.Core is a separate C# wrapper Github project that exposes RtMidi to C# programs.

It is doing so by exposing a number of functions for various message types (Note, CC, PC Sysex, and so on). I'm calling RtMidi.Core and can only show you the type of code I have. The functions and enums are, of course, part of RtMidi.Core, not RtMidi.

The developer of RtMidi.Core claims to do nothing regarding message modification before forwarding the calls to RtMidi.

Similar discussions are held in other Githib projects using coreMIDI, so I guess it is coreMIDI that performs this modification.

You can try it yourself. Just send the byte sequence 0x90,0x32,0x00 (or how you are accustomed to seeing byte arrays). What will be sent on the Midi port is 0x80,0x32,0x40.

@sagamusix
Copy link
Contributor

As a potential workaround, if it's worth the money it to you, you could get a MIDI Solutions Event Processor, put it between your Mac and the Mackie (assuming it's a 5-pin MIDI connection and not a USB connection) and translate the note-offs to note-on events with a velocity of 0.

@GuruGurra
Copy link
Author

Well, there are about 83,000 users of my software, so I don't think that is a good solution. :-)

@sagamusix
Copy link
Contributor

Ah, indeed, if it's not just a personal project that might be a bit impractical ;)

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

3 participants