Seems to be simple but…

I’m a m4L newbie and I face a difficulties. Part of my patch consist of setting the volume’s fader of any track at a specific value set in dB.

I use the raw value outlet of a slider or of a numbox to drive the live volume’s fader. The problem is to convert the scale of the raw value (from 0. to 1.) to a proper scale for the volume’s fader (from -70. to 6.).

I tried the scale object with different exponential factor : I never succeed to make the theoretical target value and the resulting value corresponding.

A track volume fader in Live has a min of 0. and a max of 1. Float values from 0. to 1. correspond to fader position, from min to max. It’s just a straight linear correspondence. So if you want to specify a setting in terms of dB, just send your dB value to [scale -70. 6. 0. 1.] and use the result to set the value of the track volume fader.

<code>

-- Pasted Max Patch, click to expand. --

Copy all of the following text. Then, in Max, select New From Clipboard.