From aebba3c875db47b09292c90cd71096cbed9226d4 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 30 Jul 2025 13:37:59 +0100 Subject: [PATCH] AAX Client: Manually declare compatibility with all channel layouts for MIDI FX Previously, MIDI FX plugins would only load on mono tracks. Now, we add a separate plugin description for each potential track layout. This is the same approach used by the example MIDI FX from the AAX SDK. --- .../juce_audio_plugin_client_AAX.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AAX.cpp b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AAX.cpp index 122fce805f..400b2a0813 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AAX.cpp +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AAX.cpp @@ -2414,9 +2414,6 @@ namespace AAXClasses aaxInputFormat = aaxOutputFormat; #endif - if (processor.isMidiEffect()) - aaxInputFormat = aaxOutputFormat = AAX_eStemFormat_Mono; - check (desc.AddAudioIn (JUCEAlgorithmIDs::inputChannels)); check (desc.AddAudioOut (JUCEAlgorithmIDs::outputChannels)); @@ -2586,10 +2583,16 @@ namespace AAXClasses // MIDI effect plug-ins do not support any audio channels jassert (numInputBuses == 0 && numOutputBuses == 0); - if (auto* desc = descriptor.NewComponentDescriptor()) + for (const auto format : aaxFormats) { - createDescriptor (*desc, plugin->getBusesLayout(), *plugin, pluginIds, numMeters); - check (descriptor.AddComponent (desc)); + const auto channelSet = channelSetFromStemFormat (format, false); + const AudioProcessor::BusesLayout layout { { channelSet }, { channelSet } }; + + if (auto* desc = descriptor.NewComponentDescriptor()) + { + createDescriptor (*desc, layout, *plugin, pluginIds, numMeters); + check (descriptor.AddComponent (desc)); + } } } else