Basic Automatic Volume Control

    Mar 27 2014 | 3:50 pm
    Dear All,
    I am trying to recreate a basic automatic volume control within Max. I am using a eternal mic input to pick up the noise in the room routed into a live.gain~ . On another channel I have a track playing off an play~ and buffer~ into a live.gain~.
    What I am trying to achieve is to increase the music volume if the noise inside the room increases.
    What I'd like to know is if I can take the output of the 5th outlet of both live.gain~ (which outputs dBs values) and feed it into a IF and create a statement like
    "if ch1 is xdB louder than ch2 then increase ch2 of ndBs"  and vice versa  "if ch2 is xdB louder than ch1 then reduce ch1 of ndBs"
    Is that even humanly possible? Unfortunately I am not a ninja in Max but when it comes to maths I'm a real donkey :/
    Any ideas out there?

    • Mar 28 2014 | 9:19 am
      is it the topic not interesting enough? or it is incomprehensible way I have explained?
    • Mar 28 2014 | 8:31 pm
      Automatic gain control is possible, although it's tricky if you're outputting the sound into the room. If you turn up the sound, the room gets louder, so you turn up the sound some more, and ...hilarity ensues.
      I think your live gain idea is ok, although one object doesn't allow you to the gain of each channel individually. I might do something like this:
      Probably you'll need more features to get the result you're after.
    • Apr 01 2014 | 8:52 am
      Hi MZED, thank you very much for your feedback.
      Here you can see where I am with this patch. But as you already guessed, what I am struggling with is the music played in the room being picked up as the actual noise to be compensated
      What do you think about the use of the IF? Although, I guess the result would be the same just tackled from a different angle..?!
    • Apr 01 2014 | 10:14 pm
      You could try removing some of the sound amplitude you're putting into the room from the amplitude you're evaluating, like:
      This is rather hack-ish, but it might get you there. Filters on the input signal might be another possibility. It will be very difficult to get a scientifically precise result, but a little gain boost if the room gets loud should be possible.