Trouble finding index corresponding to Nth channel of AAX output in processBlock()

The AAX wrapper reorders the channels in the AudioBuffer to the JUCE order which is different to the AAX order… so you would process your AudioBuffer in the JUCE order… if you need to know the original AAX channel order you’ll have to deal with that yourself… JUCE has no mechanism currently to get that. the AAXClasses aren’t available publicly…

I recently started a thread which discussed some of this:

I created a separate utility with copies of some of the AAXClasses’ code in a new namespace with this:

static StringArray getAAXSpeakerArrangementAsString (AAX_EStemFormat aaxStemFormat)
{
    StringArray speakerTypes;
    
    int layoutIndex;
    
    for (layoutIndex = 0; aaxChannelOrder[layoutIndex].aaxStemFormat != aaxStemFormat; ++layoutIndex)
        if (aaxChannelOrder[layoutIndex].aaxStemFormat == 0) return {};

    auto& channelOrder = aaxChannelOrder[layoutIndex];
    const auto& speakerOrder = channelOrder.speakerOrder;
    
    for (auto spker : speakerOrder)
        {        
        String szChannel = AudioChannelSet::getAbbreviatedChannelTypeName (spker);
        
        speakerTypes.add (szChannel);
        }
    
    return speakerTypes;
}

I actually was gonna contact the JUCE devs to ask them to reformat the AAX wrapper slightly which would help us not have to duplicate the AAXClasses AAX_EStemFormat and AAXChannel_StreamOrder…

Have them rename the juce_audio_plugin_client_AAX.cpp file to a header and add a #pragma once at the top… and in juce_audio_plugin_client_AAX.cpp just include the juce_audio_plugin_client_AAX.h

I had to do this for adding the AAX DSP mods as well since they also need to use the AAXClasses externally so I needed to include the juce_audio_plugin_client_AAX.h

Cheers!

Rail

3 Likes