Level Compensation when Mixing and Panning:
Filter:
Guides | Multichannel | Mixing | Panning

Level Compensation when Mixing and Panning

Balancing Levels when Mixing and Panning in SC

Considerations

Multichannel Expansion is one of the key features in SuperCollider, making it easy to explore complex polyphonic synthesis and spatialisation. Mixing and panning these signals usually involves going from a number of input channels to a different number of output channels, and for adapting the signal amplitude levels meaningfully, there are two aspects to consider:

1. Technical safety: What will be the maximum amplitude of the new signals? In the worst case, can they clip the audio hardware (by going above +-1.0)?

2. Perceived loudness: How loud should the new signals it be, relative to others present?

To balance these aspects, it helps to know more about the signals to be mixed/panned. Most UGens in SC produce a signal amplitude of 1.0, so we will use that value for the discussion here.

Degree of Phase Correlation: How likely is it that the momentary peaks of the individual signals will line up in time? The two border cases are fully in-phase: the same signal on all channels, so the peaks will always line up, and fully random phase: different noise signals on all channels, where the peaks will be statistically very unlikely to ever line up. Most musical signals are somewhere between these extremes, i.e. phase-correlated to some degree.

Equal Amplitude Compensation is the safe bet for highly correlated signals: divide the sum of the number of channels; Equal Power Compensation is commonly used for weakly correlated signals, as it keeps the acoustic energy constant by dividing the sum through the square root of the number of channels. As most musical signals are somewhere between the extremes, it makes sense to consider and test for the specific case whenever in doubt.

In the acoustics literature, this level compensation factor is called the p-value [1], and it can be generalized as follows:

Here are some examples for the common cases of Mixing and Panning.

Mixing M channels to 1

Mixing down to mono is the simplest case to show the different approaches to level compensation. UGens or functions for this are Mix, sum, mean.

Panning 1 channel to 2

Pan2 uses equal power panning: when panned to the center, both signals are at 0.7, or -3 dB

LinPan2 uses equal amplitude panning: in the center, both signals are at 0.5.

Panning 1 channel to N

PanAz uses equal power panning, so with a default width of 2, it keeps the energy constant, like Pan2.

Mix/Panning M to 2 channels

Splay mixes an array of input channels down to stereo using Pan2, and it has 3 options for level compensation:

Note that this levelComp factor scales with the number of channels, so tuning to somewhere between 0.5 and 1.0 should work well when experimenting with changing numbers of channels.

Mix/Panning M channels to N

SplayAz mixes an array of M input channels to N outputs using PanAz; it has 3 options for level compensation:

[1] Laitinen, Mikko-Ville, et al. "Gain normalization in amplitude panning as a function of frequency and room reverberance." Audio Engineering Society Conference: 55th International Conference: Spatial Audio. Audio Engineering Society, 2014.