refactor ambisonic busses
This MR tries to simplify how ambisonic busses are provided to makeAmbi
, makeAmbiFromMono
, and to some extent switchMake
.
SatieConfiguration.ambiBusIndex
contains an array of audio Busses used for sending B-format signals to the ambisonic post-processors. I find the word "Index" at the end of this variable name a bit confusing. This is why I've chosen to rename it to simply ambiBus
. It could also be called ambiBuses
, but my preference is for the singular. config.ambiBus.at(0)
makes more sense to me than config.ambiBuses.at(0)
. Other than the name, nothing has changed with this variable of SatieConfiguration
.
Methods makeAmbi
, makeAmbiFromMono
, and switchMake
all have an argument named ambiBusIndex
. These too have been renamed to ambiBus
(singular makes sense here). Now, when we give these methods a Bus object, we check the number of channels of the Bus against the Ambisonic order. Checking the Bus here also helps avoid the situation we had previously where we would sometimes set ambiBus
to an Integer 0
without noticing. It should no longer be possible to pass an Integer ambiBus
to makeAmbi
or makeAmbiFromMono
without error.
@zkonate1 had asked that the situation with ambiBusIndex
in switchMake
be improved. Now, if the new ambiBus
argument is left nil
, we will try and determine the appropriate ambisonic Bus by looking at the ambiOrder
argument. This is basically what happens in replaceAmbiPostProcessor
. This change should help things.