ewx: (geek)
[personal profile] ewx

Suppose I have a pair of volumes, one for the left hand channel and one for the right hand channel, and want to represent them as a combined volume and a balance. Is there a conventional relationship between these two representations and if so what is it?

(I'm currently using this interface, but the API shouldn't matter.)

(no subject)

Date: 2006-04-14 12:05 pm (UTC)
From: [identity profile] daneel-olivaw.livejournal.com
I can't give you the software answer, but the hardware answer is that "volume" is the higher setting of the "left" and "right" channels, and "balance" is the delta between that and the lower setting, i.e. adjusting the balance changes the loudness of one channel ("left" or "right"), not both.

(no subject)

Date: 2006-04-14 12:14 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
Ha. That'll certainly do for now; I was expecting something significantly more complicated, and had got to the point of drawing surfaces in cubes...

(no subject)

Date: 2006-04-14 12:14 pm (UTC)
gerald_duck: (oreille)
From: [personal profile] gerald_duck
There are two main techniques:
  • The balance control is neutral at the centre position, and attenuates one channel or the other (logarithmically or linearly) towards silence at the endstops, oeaving the other at full volume.
  • The balance control is a linear cross-fader between 0 and 1 for left channel, and 1 and 0 for right.
(There are a variety of other profiles that are useful in applications such as DJ mixing console cross-faders, but not applicable for a left/right balance.)

The former is more useful in domestic audio systems, because it means the centre position gives 0dB gain on both channels, but it isn't constant-volume (you move the balance slider away from the centre position and the sound gets quieter). The latter is more useful in professional mixing contexts because the sound stays the same volume as you change the balance, but you need 3dB of extra headroom over the centre-balance position (i.e. either the channels can go to +3dB, or you have to drop the centre-balance level to -3dB.)

Looked at as an inverse transform, the former mechanism can represent every possible pair of left- and right-channel gain values; the latter cannot represent values where both sliders have gone to eleven </spinal-tap>.

Assuming this is for your jukebox, I'd go with the former, but I hope this is some useful background for the decision. Ask me to go into more detail at your own risk. (-8

(no subject)

Date: 2006-04-14 12:33 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
Yes, it is for the jukebox. Invertible is quite important since the mixer might be set to any combination outside the control of my software, and it would be rather a shame if the current state could not be represented!

(no subject)

Date: 2006-04-14 12:49 pm (UTC)
From: [identity profile] filecoreinuse.livejournal.com
Off the top of my head ans asssuming volume is linear in the logarithms:

Let T be the 'true' signal (or in fact the logarihm of such since it is a VU meter) and b be the balance. If b = 0, the true signal comes entirely out of the left channel and if b = 1 the true signal comes out of the right.

R = bT; L = (1-b)T

From which it is clar that

R + L = (b + 1-b)T = T
R - L = (b - 1+b)T = 2bT

Hence we can find the combined signal as T = R + L and find b as

(R - L) / (2 * (R + L)) = b

November 2025

S M T W T F S
      1
2345678
91011121314 15
1617 181920 2122
23242526272829
30      

Most Popular Tags

Expand Cut Tags

No cut tags