juce-framework / JUCE

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.
https://juce.com
Other
6.31k stars 1.67k forks source link

[Bug]: juce_midi_ci SupportedAndActive should not use `active` field for storing numChannelsRequested #1323

Closed atsushieno closed 6 months ago

atsushieno commented 6 months ago

Detailed steps on how to reproduce the bug

I'm building my own MIDI-CI client in Kotlin, and noticed that my Set Profile On requests to JUCE CapabilityInquiryDemo is ignored when its address is 0x7E or 0x7F.

It is because my client sets "Number Channels Requested" field as 0 which is what MIDI-CI version 1.2 specification states (section 7.8).

*Note: When the Profile Destination field is set to address 0x7E or 0x7F, the number of Channels is determined by the width of the Group or Function Block. Set the Number of Channels Requested field to a value of 0x0000.

This field in Set Profile On message is, however, defined as active field in SupportedAndActive struct, and when it is 0 then isActive() returns false, resulting in a Profile Disabled Report reply.

Repro steps:

Or, in case you really want to use, my midi-ci-tool in this GitHub repo https://github.com/atsushieno/ktmidi/ (0a3d819 is known to reproduce, HEAD may not as it is under heavy development). It has a bug workaround switch for this exact issue on its Settings option on the main UI. (I'm not going to give full explanation on how to use IntelliJ IDEA to build and launch the app...)

What is the expected behaviour?

juce_midi_ci Responder (maybe some code in ProfileHost) should really set profile on when it received Set Profile On message whose address is 0x7E or 0x7F.

Operating systems

macOS

What versions of the operating systems?

13.5.2 (22G91)

Architectures

ARM

Stacktrace

No response

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

reuk commented 6 months ago

Thanks for reporting. This indeed looks like a bug in our CI support.

I've pushed a fix here: https://github.com/juce-framework/JUCE/commit/1506bb3454905c67c72104df3f9d51aa08fd3765