🐢 MCG · Matched Channel Gain

One packet.
Many channel faders.
One gain.

Matched Channel Gain resolves a single output gain for a received intercom packet by combining the faders of the subscribed logical channels that match that packet.

cuts blend smoothly boosts use max() capped at 150% no duplicated audio paths required

Matched Channel Gain as a mathematical function

Let P be the packet's channel memberships and S be the listener's subscribed channels. Matched Channel Gain only looks at the overlap. In compact notation below, MCG means Matched Channel Gain.

M = P ∩ S
MCG(M, g, p, G) = 0, if |M| = 0
MCG(M, g, p, G) = clamp(A(M) × B(M), 0, G)
A(M) = ( 1/|M| · Σc∈M min(gc, 1)p )1/p
B(M) = max(1, maxc∈M gc)
gc is a channel's linear gain: 0.0 mute, 1.0 unity, 1.5 max boost.
p = 2 gives RMS / equal-power attenuation. Higher values move toward max-like behavior.
G = 1.5, so final output cannot exceed 150% linear gain.
  1. Find matching channels: packet membership AND listener subscription.
  2. Combine cuts with a power mean so one muted overlap does not erase every other path.
  3. Combine boosts with max() so boosts do not stack louder and louder.
  4. Apply the resulting single gain to the one received packet.
Matched Channel Gain is not deduplication. It assumes there is already only one packet/audio object. The job is to resolve multiple logical channel controls into one gain decision.

Interactive little gain pond

Toggle which channels the packet belongs to, which channels the listener subscribes to, and move the faders.

0.707x
final packet gain
matching
2 channel(s)
0%unity 100%max 150%
attenuation A(M)0.707
boost B(M)1.000
clamp max G1.500
matching gains
live calculation
A = sqrt((0² + 1²) / 2) = 0.707 · B = 1.000