I’ve been working on some level meters for my GUIs and I’ve come across an issue where JUCE loses the order of the channels being passed in to the AudioChannelSet class, though the audio is routed through correctly.
If I open my plugin in 7.1.4 in Nuendo 12, Nuendo creates a track with the following channel order
L R C LFE Ls Rs Sl Sr Tfl Tfr Trl Trr
where Ls/Rs are the rear surrounds and Sl/Sr are the side surrounds (Nuendo’s naming scheme)
JUCE’s channel sets tells me that my plugin has the following channel order
L R C LFE Lss Rss Tfl Tfr Trl Trr Lrs Rrs
I can see that the AudioChannelSet stores the channels as bits in a juce BigInteger, but why is this?
This causes problems when trying to represent the DAW’s routing in the plugin, as I now have to worry about rearranging the channels internally.
Would it not be possible to store the channels as an array, to preserve the order?
Also, could the getAbbreviatedChannelTypeName() function take the DAW into account too?
(left side surround currently gets named as “Lss” in Nuendo, it should be “Sl”)
I had to write a remapper using code from the plugin format dependent maps that JUCE applies for VST3 and AAX (I didn’t do AU yet but it should be simple enough). AAX required some copy/pasting of some code, which seems messy.
As daniel says, there is no guaranteed that the order they arrive at the plugin (pre-JUCE remapping) is the same as the order in the track in the DAW. This is highly frustrating as soon as you want to work with anything outside that standard layouts. Hopefully plugin API people will add to this soon. The way VST2 worked was essentially ideal.