gain~ slider question

tflood's icon

Hello-

How might I use a single gain~ slider to control the output levels of a
stereo pair? The gain~ object takes only one audio input, so I am
trying to figure out some sort of work-around.

Thank you,

-Tim

Steven Miller's icon

The right outlet of [gain~] outputs the current slider position as an
int, and the left inlet of [gain~] takes an int to specify its
current position. So, you can just hook up the left outlet of one
[gain~] to the right inlet of the other to connect them into a stereo
pair (or multi-channel) set with one acting as the 'master' fader.

See this patch for example:

Max Patch
Copy patch and select New From Clipboard in Max.

On Jan 1, 2007, at 3:04 PM, Tim Flood wrote:

> Hello-
>
> How might I use a single gain~ slider to control the output levels
> of a stereo pair? The gain~ object takes only one audio input, so I
> am trying to figure out some sort of work-around.
>
> Thank you,
>
> -Tim
>

----
Steven M. Miller

Associate Professor of Contemporary Music
College of Santa Fe
Contemporary Music Program
1600 St. Michaels Drive
Santa Fe NM 87505
http://pubweb.csf.edu/~smill
(505) 473-6197

~~~~~~~~~~~~~~~~~~~~~
SFIFEM
Atrium Sound Space
OVOS
*opportunities for composers & sound artists*

seejayjames's icon

As mentioned, one slider can control two with their additional outlets. I usually have a middle fader between the L / R to do just this during testing (connect right outlet to left inlets of the L/R).

Better yet, I usually have a L / R pair independent of each other, then a master fader below that, so one controls the *relative* levels of both, so the balanced mix can be scaled. This master fader won't change the levels of the L / R, it will just scale the overall result (after the L/R).

Remember that you can use gain faders to smooth out jumps of other (numerical) sliders (to avoid audio clicks). These faders can even be hidden from the user if desired. This way you can use other sliders (i.e., non-logarithmic) to control the volume. And the slew inlet (right one) is settable for the milliseconds of time it takes to go from one setting to the next, which not only avoids clicks but can be a nice portamento effect for volume--and it settable by the user too.

--CJ