-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
MPEZoneLayout: reset MidiRPNDetector once RPN message processed #1331
MPEZoneLayout: reset MidiRPNDetector once RPN message processed #1331
Conversation
I'm not convinced. The MIDI 1.0 spec says the following:
I interpret this as meaning that, if we send Resetting the MidiRPNDetector detector would cause it to forget the LSB and MSB of the selected parameter number, so this use-case would fail. The spec also says:
From the forum post, it sounds like the problem is caused by combining two MIDI streams, where each stream attempts to modify a different registered parameter without selecting the intended RPN each time. How are the MIDI input streams combined? Are you relying on the OS to combine the streams, or do you combine them yourself? If you're doing this yourself, then I think the correct way to implement this is for the combiner to maintain a separate RPN state for each of the input streams, and also for the output stream. Whenever a data-entry, data-increment, or data-decrement message is encountered on either input stream, if the selected RPN on that input differs from the selected RPN on the output, then insert additional messages in the output stream to select the correct RPN. |
I agree that the Midi 1.0 spec with regards to RPN and NRPN messages should allow for receiving individual MSB and LSB messages after the Parameter value portion of the message has been received. This is the general use case of RPN/NRPN messages. However in the specific case of MPE MCM config message, the specification states that for MCM config message the LSB is ignored:
So once the MSB data entry (CC6) portion of the RPN message has been received, there is no need to wait for an LSB message - as it is not used as part of the MPE configuration.
In our specific case only one of the senders is failing to emit a full NRPN message (from a third party piece of hardware) and causing these issues.
I had initially hoped to handle it this way, but the Midi streams are being combined at the DAW level (in this case Ableton) before being received by our plugin - so there's no way to differentiate between streams and handle RPN states for different sources from within our plugin. |
As an alternative, adding a member function to the |
Have you submitted this as a bug report? Ableton might not be aware of this behaviour. If the DAW is producing a MIDI stream that sets the RPN such that following data-entry messages apply to the wrong RPN, that sounds like it could be a bug. If you've not tested the latest version of Live, that might be worth trying too.
I'm not sure about this. Having some kind of reset seems reasonable, but not for resolving the issue you're facing. I think there are valid use-cases where the sender of the MIDI messages might assume that the receiver has remembered the currently-selected RPN, so forgetting/resetting the selected RPN after selecting the MPE configuration RPN might also cause problems. If you wanted to keep the functionality you suggested, you'd also need to call If you really want the behaviour you're suggesting, I think you could implement it by using your own MidiRPNDetector (i.e. avoid |
Thanks for the pointers. Much appreciated. |
This is to address this issue raised on the JUCE forum: https://forum.juce.com/t/juce-mpe-mode-configuration-implementation-issue/59537
As detailed in the MIDI spec - the MPE Configuration Message is an RPN message:
It only expects the MSB portion of the Parameter Value - and ignores the LSB. With that in mind, it would be best to reset the MidiRPNDetector object after the MSB value is received and avoid any spurious updates happening after (since otherwise the MidiRPNDetector object would remain active to receive any further MSB and LSB messages - as per the Running Status implementation)