I’ve been trying to debug a plugin in which I use 7.1.4 as well as 9.1.6 channel layouts.
In Nuendo and Resolve (not aware of another software that supports 9.1.6), the 7.1.4 are laid out correctly, but the 9.1.6 behaves strangely (channels aren’t laid out correctly).
Whilst debugging sound with Resolve, sending signal just to channel 0 in a 7.1.4 track I get the following debug:
layout.getChannelIndexForType(juce::AudioChannelSet::left)
As you can see, sound does come through channel 0 correctly.
In a 9.1.6 track, however, the result is as follows:
As you can see, channel 0 is being sent to 12?
I contacted Blackmagic to try and sort this out, but they replied this was a JUCE issue, and provided the following information:
[QUOTE from Blackmagic:]
Here’s the internal JUCE code in question [in juce_VST3_Wrapper.cpp]. That bufferMapper appears to be the internal translation of the VST3 format order to the internal JUCE channel order – but, as you can see – that’s clearly messed up for 9.1.6.
template <typename FloatType>
void processAudio (Vst::ProcessData& data)
{
ClientRemappedBuffer<FloatType> remappedBuffer { bufferMapper, data };
auto& buffer = remappedBuffer.buffer;
jassert ((int) buffer.getNumChannels() == jmax (pluginInstance->getTotalNumInputChannels(),
pluginInstance->getTotalNumOutputChannels()));
I’ll note also the following comment in the JUCE 9.1.6 format definition:
/** Creates a set for a 9.1.6 surround setup (left, right, centre, LFE, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear, wideLeft, wideRight, topFrontLeft, topFrontRight, topSideLeft, topSideRight, topRearLeft, topRearRight).
Note that the VST3 layout arranges the front speakers "L Lc C Rc R", but the JUCE layout
uses the arrangement "wideLeft left centre right wideRight". To maintain the relative
positions of the speakers, the channels will be remapped accordingly. This means that the
VST3 host's "L" channel will be received on a JUCE plugin's "wideLeft" channel, the
"Lc" channel will be received on a JUCE plugin's "left" channel, and so on.
Is equivalent to: k91_6 (VST3), kAudioChannelLayoutTag_Atmos_9_1_6 (CoreAudio).
*/
static AudioChannelSet JUCE_CALLTYPE create9point1point6();
So, the remapping that you note where channel 0 appears on channel 12 is actually this remapper within Juce.
Our own channel order is of course the 9.1.6 SMPTE one, which we’re mapping to the VST3 k91_6 format.
[END QUOTE]
To add: Nuendo as well seems to mess the channel (Left) and of course, in consequence, the whole layout.
Needless to say, would love to find a possible suggestion / fix
Suggestion: Why not, instead of messing the SMPTE order, you just simply remap channels Lc and Rc in the proper SMPTE order (as if they were Lw and rW), and then it’s the developer who decides whether they are wide or centre?