josephdadams / midi-relay

Listens for HTTP request with JSON payload and relays MIDI/MSC commands on local ports.
MIT License
58 stars 9 forks source link

BUG - Macos/Ableton - Midi notes are recieved in Ableton, but do not show up in the input channels #41

Closed FhinMusic closed 1 year ago

FhinMusic commented 1 year ago

Describe the bug When using Midi relay as an input in ableton live, the midi indicator does blink and it's possible to assign midi notes and cc to different parameters without a problem. But when it comes to using the midi notes on/off as an input on a midi channel (like an external synth) the notes aren't even detected.

To Reproduce Steps to reproduce the behavior:

  1. Use midi-relay with Ableton 11.2.11 on MacOS Ventura 13.3.1, so with through the IAC driver
  2. Use the midi relay midi device as input for a midi track (like a midi keyboard), don't forget to use All Channels and press in
  3. Observe that the midi in indicator in the upper right of Ableton is showing the notes are being received, but the usual midi indicator next to All Channels is not showing anything, and no notes are being played by the instrument

Expected behavior Those midi notes should show up as midi notes in ableton and be played, like it does perfectly (I checked) with any other control surface or midi keyboard (regardless if it's in track, remote, sync mode etc)’

Screenshots Midi IN indicator working :

Screenshot 2023-06-06 at 17 24 20

No notes being detected in any channel

image

The input notes can still be used as random midi controls tho

image

Desktop (please complete the following information):

Additional context I've seen people having similar problems using other solutions with IAC drivers, something to do with timestamps not being sent with the midi message, or some latency stuff, i'm not sure

FhinMusic commented 1 year ago

Here's someone that found a fix for the same problem on another virtual midi program

FhinMusic commented 1 year ago

More info using the integrated MIDI Monitor, it seems that the notes played by Midi Relay are incredibly fast and that could be the problem

Here's what a normal Midi keyboard does when playing a G1 on a midi track on ableton

image

Here's what this button : image Does when clicked the same way on the streamdeck ()

image

Observe that there's a CTL message that's received (no idea what it is) and that everything happens basically at the same ms. Using ch16 is not a mistake, it should still show up in All Channels, using a note off on release basically just adds a CTL type on top of the rest, but still doesn't work

Also it's playing G0...? I'm confused but maybe it's just offset in ableton and isn't relevant to the problem I've checked the companion instance code and saw that midi relay was 0 based, also my friend probably played G-1 on his keyboard instead of G1 lmao, but this shouldn't be relevant

josephdadams commented 1 year ago

This is an interesting one for sure

jsjoen7896 commented 1 year ago

I just added a feature request relating to this same issue. "All Notes Off" (CTL 123) is being sent for every channel on every "Note On" / "Note Off" message. Not sure if this is something with the jzz.midi node module, or something deeper in the system. Notice in the screenshot, "B0"-"BF" is channel 1-16, and "7B" is "All Notes Off".

Midi messages

josephdadams commented 1 year ago

I can confirm that I see it also, but I can also confirm I have no idea why it happens

jsjoen7896 commented 1 year ago

So I think I've found the issue doing some node.js testing. I've successfully opened and transmitted MIDI through a local MIDI port on my computer using the jzz node module. As it turns out, every time you close the midi port with "port.close()", it will actually automatically send the "All Notes Off" message for every channel on that port. Same thing when calling "navigator.close()" (JZZ.Close()) as this closes all the ports anyway. This might be a general MIDI protocol thing, but I'm not sure.

If there was some way to keep the ports you are using open during the process, and maybe have a timeout for when there is long inactivity to close the port, that would probably solve the issue.

image image

josephdadams commented 1 year ago

https://github.com/josephdadams/midi-relay/blob/f1ca364ac0ea246e862031a67ecb7bf958bc3b1f/midi.js#L143

josephdadams commented 1 year ago

Mayhaps it’s this

josephdadams commented 1 year ago

Pushing midi-relay v3.1.1 with a fix for this