Seems to be simple but...

noyos's icon

Hello,

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.

Do you have a solution ? Part of an existing patch ?

Thanks in advance.

Cédric

vichug's icon

check [atodb] and/or [atodb~] ?

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

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.

noyos's icon

Thanks a lot for your answers.

@ Vichug
I didn't know this object, thanks, that's a good start for me. I tried 2/3 things but the problem remain the same, I have to work hard !

@ Christopher
I already try this trick but the live fader does'nt answer with the right scale.

For example, 0dB on Live fader returns a 0.85 value, a live.slider object [-70. 6.] or a live.gain object return 0.92 after a [scale -70. 6. 0. 1.]. That's the same with the raw value output.

If you foresee any solution, I'll catch it !

Thanks in advance

Noyos