# AAX Channel order

**URL:** <https://forum.juce.com/t/aax-channel-order/56181>\
**Category:** Audio Plugins\
**Created:** [May 11, 2023, 5:22pm UTC](https://forum.juce.com/t/aax-channel-order/56181 "2023-05-11T17:22:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [May 11, 2023, 5:22pm UTC](https://forum.juce.com/t/aax-channel-order/56181/1 "2023-05-11T17:22:05Z")

</div>

So I create a 7.1.2 track in Pro Tools and in prepareToPlay() I do some checking using:

```auto
    AudioChannelSet channelSet = m_LastLayout.getMainOutputChannelSet();
    
    int iNumChannels = getTotalNumOutputChannels();
    
    for (int i = 0; i < iNumChannels; ++i)
        DBG (juce::AudioChannelSet::getChannelTypeName (channelSet.getTypeOfChannel (i)));
    
    if (iNumChannels > 2)
        {
        const auto iIndex = channelSet.getChannelIndexForType (juce::AudioChannelSet::centre);
        const auto channelIndex = getChannelIndexInProcessBlockBuffer (false, 0, iIndex);

        DBG ("centre Index: " << channelIndex);
        }

```

prints out:

Left  
Right  
Centre  
LFE  
Left Surround Side  
Right Surround Side  
Left Surround Rear  
Right Surround Rear  
Top Side Left  
Top Side Right

centre Index: 2

which is incorrect for

```auto
AAX_eStemFormat_7_1_2, { 

AudioChannelSet::left, 
AudioChannelSet::centre, 
AudioChannelSet::right, 
AudioChannelSet::leftSurroundSide, 
AudioChannelSet::rightSurroundSide,
AudioChannelSet::leftSurroundRear, 
AudioChannelSet::rightSurroundRear, 
AudioChannelSet::LFE, 
AudioChannelSet::topSideLeft, 
AudioChannelSet::topSideRight }

```

Centre index should be 1

I see in the wrapper that rebuildChannelMapArrays() should remap the channels… but it doesn’t seem to be working.

Also if I use

```auto
AudioChannelSet set = layout.getMainOutputChannelSet();

StringArray szSpeakerArray = StringArray::fromTokens (set.getSpeakerArrangementAsString(), false);

```

The order is also wrong and reports L, R, C, …

Rail

---

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [May 11, 2023, 5:26pm UTC](https://forum.juce.com/t/aax-channel-order/56181/2 "2023-05-11T17:26:38Z")

</div>

m\_LastLayout is initialized and reset in:

```auto
void DRC2NativeAudioProcessor::processorLayoutsChanged()
{
    juce::AudioPluginInstance::BusesLayout newLayout = getBusesLayout();

}

```

Rail

---

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [May 11, 2023, 7:25pm UTC](https://forum.juce.com/t/aax-channel-order/56181/3 "2023-05-11T19:25:30Z")

</div>

Okay… It appears that the AudioBuffer is sorted in the AAX wrapper to match the JUCE order:

0  
2  
1  
7  
3  
4  
5  
6  
8  
9

So I guess I have to re-order the meter and channels in the UI to display them in the expected AAX order… but it would help if there were some methods in the AudioChannelSet class to get the native channel order.

Rail

---

<div class="post-metadata">

**Author:** ![AdamVenn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamvenn/32/17023_2.png) [@AdamVenn](https://forum.juce.com/u/AdamVenn)\
**Post date:** [February 2, 2025, 10:23pm UTC](https://forum.juce.com/t/aax-channel-order/56181/4 "2025-02-02T22:23:46Z")

</div>

Just hit this myself. So confusing! Glad I’m only doing up to 6 channels…

Having some methods in the AudioChannelSet class is a great feature request.

Thanks for posting about this, Rail. It was very helpful.

---

<div class="post-metadata">

**Author:** ![pstitt01](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pstitt01/32/2610_2.png) [@pstitt01](https://forum.juce.com/u/pstitt01)\
**Post date:** [February 3, 2025, 9:57am UTC](https://forum.juce.com/t/aax-channel-order/56181/5 "2025-02-03T09:57:16Z")

</div>

Some methods to get the original channel order would be great. The same for VST3. I believe the mapping from input to JUCE ordering is stored in the wrappers so it could hopefully be fairly easily added.
