dB-based (-70. dB to 6. dB) gain control without GUI?

Masa's icon

Hi, I am using live.gain~ to adjust the loudness of audio signal with dB.
Has anyone implemented the dB functionality (silence, -70. dB to 6. dB) of live.gain~ without GUI?
Perhaps the combination of 'scale -70. 6. 0. 157.' and 'gain~' is the simplest solution...?
I am optimising my patch.

Thanks a lot,
Masa

geoscle's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Stephane Morisse's icon

As far as I know, the above solution, even if it is correct, won't reflect the values output by live.gain. I had a very hard time trying to get this using expressions or that kind of stuff and never got a clear answer by Ableton about their scaling, even for internal live mixer. The closer solution used an array of values. I'm going to try to find it...

Christopher Dobrian's icon

I think it's something more like this. (I.e., if gain value is less than -70 dB, set gain to 0.)

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

Masa's icon

Hi, thank you very much Franz, Stephane and Christopher for your smart input.
OK, then I will replace all my live.gain~s with Christopher's approach and see if it reduces CPU usage.

Masa's icon

I modified Christopher's patch, as live.gain~ mutes the signal when equals to -70.

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

Masa's icon

As Stephane noted, when trying fading out with gain value, live.gain~ sounds smoother than my patch above. I am not sure why.