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?