setSample to correct DAW channel number? (SOLVED)

I am trying to send audio to my outputs on a multichannel environment, and since Pro Tools has different channel order than, say, Nuendo, I was wondering if there’s a way to send the audio to the channel index given by the DAW.

For example, 3-channel in Nuendo is LRC whereas in Pro Tools is LCR… how can I send audio to, say, R? Do I have to create a whole set of rules for my plugin to check the DAW? Or is there a variable that simply sends to “R” regardless of it being Channel index 1 or 2?

Have a look at AudioChannelSet. That has the names for all possible channels.
And the AudioProcessor has methods to get the index mapped, e.g. AudioProcessor::getChannelIndexInProcessBlockBuffer() and related functions in getBus()…

So upon calling DBG in the processBlock

DBG(juce::AudioProcessor::getChannelIndexInProcessBlockBuffer(false, 0, juce::AudioChannelSet::centre));

I get 3 regardless of the DAW (Reaper, Pro Tools Ultimate), shouldn’t I get 2 in Pro Tools when in a 5.1 track? What am I doing wrong?

I appreciate the help :slight_smile:

IIRC juce reorders the channels to a consistent order…

So what would the best approach here when working in a 5.1 bus, if AAX is LCR… and VST is LRC…?

Should I fill an array with the values depending on the wrapper, and then use the array for the output? or is there a “cleaner” way?

Have you tried what happens? I think the wrapper fixes it behind the scenes for you. But only Fabian @fr810 could tell for sure. He wrote the multi bus back then.

Those mapping function exist exactly for that reason and should yield the correct result in each format. If not I would say it’s a bug.

Thank you! Ok I tried and indeed the wrapper sorts everything out!