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

MIDI Action sending wrong value #1164

Open
UUoocl opened this issue Jul 31, 2024 · 2 comments
Open

MIDI Action sending wrong value #1164

UUoocl opened this issue Jul 31, 2024 · 2 comments

Comments

@UUoocl
Copy link

UUoocl commented Jul 31, 2024

Describe the bug
There is an error in the MIDI Action where the set value of Value(2) are not being sent. Specifically in the "Type = Note On" when value(2) is set to '0'. Instead of '0' being sent, value(2) is being sent as '1'.

When value(2) is set to a number greater than 0 the value is sent as expected. 1=1, 2=2, etc.

I noticed this error because I have a device that uses "Note On, Channel 1, value(1) 100, value(2) 0" to turn off an led. Sending messages from Advanced Scene Switcher would not turn off the led. Sending "Note On, Channel 1, 100, 0" from another app would turn off the led.

To reproduce this error.

  1. create a MIDI Action
  2. set the type = Note On, value(1) = 100, value(2) = 0
  3. Run the Macro
image

The tool MIDI Monitor for MacOS is used to view the message
In this test "Note On Channel 1, value(1) = 100, value(2) = 0" are sent from Advanced Scene Switcher and the message observed from MIDI Monitor is displayed.
In this example the settings are
Type "Note On" Ch=1, Value(1) = 100, Value(2) = 0, and the sent message is
Type "Note On" Ch=1, Value(1) = 100, Value(2) = 1

I think MIDI Monitor is correct because the device receiving the message doesn't react

In this next example the settings are
Type "Note On" Ch=1, Value(1) = 100, Value(2) = 1
and the results are correct

image

Expected behavior
I think the 2nd value of the MIDI "Note On" should be able to be Set to 0 and send 0.

Logs
The log matches the Action's settings.

19:22:35.959: [adv-ss] send midi message "Type: Note On Note: 100 Channel: 1 Value: 0" to "[AKAI professional APC mini mk2 Control] APC mini mk2 Control"

19:18:17.146: [adv-ss] send midi message "Type: Note On Note: 100 Channel: 1 Value: 1" to "[AKAI professional APC mini mk2 Control] APC mini mk2 Control"

Version information

  • OS: MacOS 14.5
  • OBS Version 30.2.0
  • Plugin Version 1.26.4
@WarmUpTill
Copy link
Owner

The plugin is using the libremidi library under the hood to send out messages.
As far as I can tell there is no special handling in this library for this particular case.
I am also not able to reproduce the issue on my end on a Windows machine:

MidiWindows

Note on in combination with a velocity of 0 does not really make "sense" from an audio output point of view.
(At least from my very limited and potentially incorrect understanding of the MIDI message's velocity field)

Thus maybe the underlying OS specific "driver" adjusts the message to something which "makes more sense" from its point of view?

Unfortunately, I am not really sure how to best investigate this further since I have very limited testing capabilities for MacOS.

You mentioned that other tools are able to send this particular message.
Does this other tool happen to be open source as well so I can have look if there is any special handling for this particular case?

@UUoocl
Copy link
Author

UUoocl commented Aug 2, 2024

Thank you for testing this issue. That is interesting that in Windows the MIDI messages are being sent as expected. I just tested it and it works for me on Windows too.
The other tool I used to send MIDI messages in MacOS is TouchOSC. The values sent from TouchOSC are also working as expected. TouchOSC isn't open source. It is free to use the desktop version.

I intend to use a MIDI controller just as buttons for a project. You're probably right that the message doesn't make sense from an audio perspective. It's purpose in this case is to turn off a light for a specific button. Most of the messages I need can be sent using Advanced scene switcher.

I'm using Advanced Scene Switcher to test the functionality of a MIDI controller. My next step is to write the logic into javascript using webMIDI.js. I can report back if the MIDI messages are working correctly in the browser.

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

2 participants