What is the correct way to set an arbitrary number of channels? Btw, I’m calling these functions in my plugin constructor, which is set up as stereo by default. Maybe that’s part of the problem?
You should never call setCurrentLayout (or similar) from within your AudioProcessor. As a plug-in you have no control over your current layout other than specifying the default layout (which the host may or may not use) - and rejecting/accepting layouts in isBusesLayoutSupported.
Thanks Fabian, that makes sense. So in my simple host, after I create a processor, and before I add it to my AudioProcessorGraph, it’s Ok to call these AudioChannelSet methods so long as they adhere to the processor’s available layouts?
One last thing, and thank you btw, this has cleared up some long standing confusion for me!
I’ve set up my processor up with AudioChannelSet::octagonal() as I wish to support up to 8 channels. In order to support custom configurations I should make sure my isBusesLayoutSupported() methods returns true for any configuration up to 8 channels? Seems to work, but it would be nice to hear this is a valid approach!
Yes that sounds like a valid approach. Just note that if you don’t really care about the layout of the individual speakers (i.e. the third channel is a centre speaker etc.), then just check the AudioChannelSet's number of channels in your isBusesLayoutSupported method via the size method.