I’m working on an AAX plugin that’s capable of outputting a number of layouts with a number of different channel widths. I’ve noticed that the nth channel in the processBlock array doesn’t necessarily correspond to the nth channel of the output in pro tools, so I’m in search of a method that will let me get the process block array index corresponding to the Nth channel of the plugin’s output. I thought I may have found this in getChannelIndexInProcessBlockBuffer, but I’m finding this difficult to use (perhaps because I’m using it wrong). Since there’s only one output bus, I tried getChannelIndexInProcessBlockBuffer(false, 0, n) to get the process block buffer index corresponding to the nth output channel, but I find that I always get n back though even when this is not the case (in LCR, for example, the channel corresponding to the “1” index in processBlock is the third channel of the output; I can provide an example if necessary).
I’d be surprised if there isn’t a method to do what I need already around – can anyone here point me in the right direction?
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: