ATMOS channel layouts: How To?

Hi There,

I wonder how JUCE wants us to implement different channel layouts, especially with higher channel count. I’ve learned that AudioChannelSet stores all information of interest (used channel types, names,…) but ignores the order completely (channel enums are stored in a BigInteger bitmask).
I.e. e.g. AudioChannelSet::create9point1point4() is sorting the channels. Why is the channel order not stored anywhere?

Next fun fact is that Logic Pro returns a discrete layout so that the plugin can’t see any channel types used on the bus, just discrete numbers.

Coming to my question: How to get through this jungle? Ditch Juce::AudioChannelSet or extend it or is there something that I miss?

  • I want to support common speaker layouts 7.1.4, 9.1.4,.., which may have different channel orders (SMPTE, Film,..)
  • Auto detecting the bus layout of the current DAW would be cool
  • fallback is either having a lot of “presets” or a free routing matrix (like e.g. Virtuoso)

I’m sure e.g. @fiedleraudio went through this hell as well : )

Thanks!

Logic supports Atmos channel layouts, but it can be a prick about it. IIRC it may prefer to create discrete layouts if you let it. So if you forbid discrete layouts, it will use the named ones instead. It’s been a while, but I vaguely remember something along those lines.

I have this in my isBusesLayoutSupported():

    if(layouts.getMainInputChannelSet().isDiscreteLayout() && layouts.getMainInputChannelSet().getChannelIndexForType(AudioChannelSet::discreteChannel0) == -1)
    {
        return false;
    }

Don’t ask me why theres also that second check. I might have actually picked that up here on the forum.

The most important footgun to deal with however is that Logic is extremely sticky with caching plugin’s channel capabilities. So when you’re messing around with those, be sure to delete the cache before trying a new build (the other option is to increment the version number each build).

Here’s the script I use for that:

#!/bin/sh
sudo killall -9 AudioComponentRegistrar
rm ~/Library/Caches/AudioUnitCache/com.apple.audiounits.cache
rm ~/Library/Caches/com.apple.audiounits.cache
rm ~/Library/Preferences/com.apple.audio.InfoHelper.plist
rm ~/Library/Preferences/com.apple.audio.AudioComponentCache.plist

Not that not all of the files may always exist. Depends a bit on OS and Logic versions I think.

Ok, thanks. This already helps a lot. I will need to distinguish between hosts then to e.g. allow discrete layouts for Reaper (which only supports those afaik)

Yea, I also learned the sticky caching the hard way : )