Topic: OSC message in dB ?
Hi
Is it possible to send volumes values in dB instead of 0 to 1 normalized values ? Or, if not, is there a formula to convert from dBs to normalized values ?
Thanks
You are not logged in. Please login or register.
RME User Forum → TotalMix FX → OSC message in dB ?
Hi
Is it possible to send volumes values in dB instead of 0 to 1 normalized values ? Or, if not, is there a formula to convert from dBs to normalized values ?
Thanks
Following.
If you look at outgoing osc messages when you turn a fader, you should see sth like this:
(/1/volume3Val) STRING(-6.9 dB
(/1/volume3) FLOAT(0.6257049)
(/1/volume3Val) STRING(-6.3 dB
(/1/volume3) FLOAT(0.65181774)
(/1/volume3Val) STRING(-5.4 dB
(/1/volume3) FLOAT(0.6605223)
(/1/volume3Val) STRING(-5.1 dB
(/1/volume3) FLOAT(0.67793137)
(/1/volume3Val) STRING(-4.6 dB
(/1/volume3) FLOAT(0.686636)
(/1/volume3Val) STRING(-4.3 dB
(/1/volume3) FLOAT(0.70404506)
(/1/volume3Val) STRING(-3.7 dB
(/1/volume3) FLOAT(0.7214542)
(/1/volume3Val) STRING(-3.1 dB
(/1/volume3) FLOAT(0.7388633)
(/1/volume3Val) STRING(-2.6 dB
(/1/volume3) FLOAT(0.764977)
(/1/volume3Val) STRING(-1.7 dB
(/1/volume3) FLOAT(0.78238606)
(/1/volume3Val) STRING(-1.1 dB
(/1/volume3) FLOAT(0.8172043)
(/1/volume3Val) STRING(0.0 dB)
(/1/volume3) FLOAT(0.843318)
(/1/volume3Val) STRING(0.9 dB)
(/1/volume3) FLOAT(0.8520225)
(/1/volume3Val) STRING(1.1 dB)
(/1/volume3) FLOAT(0.8781362)
(/1/volume3Val) STRING(2.0 dB)
(/1/volume3) FLOAT(0.9477727)
(/1/volume3Val) STRING(4.3 dB)
(/1/volume3) FLOAT(0.9564772)
(/1/volume3Val) STRING(4.6 dB)
(/1/volume3) FLOAT(0.98259085)
(/1/volume3Val) STRING(5.4 dB)
(/1/volume3) FLOAT(1)
(/1/volume3Val) STRING(6.0 dB)
The rest depends on your mathematical skills ;-)
My mathematical skills are unfortunately pretty limited but I've tried some calculations and I haven't been able to find out the relationship between these values. Here is what I've tried:
Linear: Totalmix fader range is 71dB (65 below 0 and 6 above 0) so a linear calculation with an OSC value of 0.5 would be 0.5 * 71dB = 35.5dB.
Then -65dB + 35.5dB equals -29.5dB but it doesn't seem to work this way, sending 0.5 sets the fader to -12.1dB...
I did a few other logarithmic calculations that didn't give the results I expected either.
But since Totalmix is able to send back gain values in dB, there has to be a way to calculate it so maybe RME could help ?
yop, of course, its not linear. you could have seen this even after comparing 3-4 Key/Values, i posted yesterday.
There are several methods to calculate a function from key/val Table (depends on the type).
Here is a good starting point (in german), if you want to learn: https://www.informatik.uni-marburg.de/~ … abelle.pdf
Or... i extracted a pretty quick fader slide from button to top, and sorted the Value to dB pairs (just for you;-)).Just copy/paste my table into excel (or openoffice, or pages) and let it draw a diagram. I am sure there is an option anywhere to calculate the final function formula. I am not a excel hero - so i dont know how (as i prefer a pencil and a blank sheet of paper for things like that).
hope it helps!
Value dB
0.008687576 -63.7
0.017375093 -62.4
0.026062608 -61.1
0.034750246 -59.8
0.04343788 -58.5
0.052125454 -57.3
0.06081315 -56.0
0.06950079 -54.8
0.07818848 -53.6
0.086876236 -52.4
0.09556393 -51.2
0.10425174 -50.1
0.1129395 -48.9
0.121627316 -47.8
0.13031518 -46.6
0.147691 -44.4
0.15637898 -43.4
0.16506693 -42.3
0.17375498 -41.2
0.18244304 -40.2
0.19113109 -39.2
0.19981919 -38.2
0.20850737 -37.2
0.2258839 -35.2
0.23457219 -34.3
0.24326053 -33.4
0.25194895 -32.4
0.26063743 -31.5
0.26932594 -30.6
0.27801454 -29.7
0.2867032 -28.9
0.29539183 -28.0
0.30408067 -27.2
0.3127695 -26.4
0.32145846 -25.6
0.33883652 -24.0
0.34752572 -23.2
0.35621497 -22.5
0.36490437 -21.7
0.37359387 -21.0
0.38228348 -20.3
0.39097318 -19.6
0.39966303 -18.9
0.40835303 -18.3
0.41704318 -17.6
0.42573345 -17.0
0.4344239 -16.4
0.44311455 -15.7
0.45180538 -15.2
0.46049643 -14.6
0.46918768 -14.0
0.4778792 -13.5
0.495263 -12.4
0.5039553 -11.9
0.512648 -11.4
0.5213411 -10.9
0.53003454 -10.5
0.5387284 -10.0
0.5474227 -9.6
0.5561176 -9.2
0.5648131 -8.7
0.5735092 -8.4
0.5822061 -8.0
0.5909037 -7.6
0.59960234 -7.3
0.60830194 -6.9
0.6170027 -6.6
0.6257049 -6.3
0.64311314 -5.7
0.6605223 -5.1
0.6692268 -4.9
0.67793137 -4.6
0.686636 -4.3
0.6953405 -4.0
0.70404506 -3.7
0.7214542 -3.1
0.73015875 -2.9
0.7388633 -2.6
0.7562724 -2.0
0.764977 -1.7
0.7736815 -1.4
0.78238606 -1.1
0.7910906 -0.9
0.7997952 -0.6
0.80849975 -0.3
0.8172043 0.0
0.82590884 0.3
0.83461344 0.6
0.843318 0.9
0.8520225 1.1
0.8694316 1.7
0.8781362 2.0
0.88684076 2.3
0.8955453 2.6
0.90424985 2.9
0.91295445 3.1
0.921659 3.4
0.93036354 3.7
0.9390681 4.0
0.9477727 4.3
0.9564772 4.6
0.96518177 4.9
0.9738863 5.1
0.98259085 5.4
0.99129546 5.7
1 6.0
Thanks a lot for taking the time to help me maggie33. Unfortunately, using series to determine a function is beyond my mathematical knowledge (I've imported the numbers to Openoffice Calc and been able to draw the graphic but I can't find a way to get the function).
I would really appreciate if someone from RME could chime in and give the formula
Maybe try this then https://www.dcode.fr/function-equation-finder
Maybe try this then https://www.dcode.fr/function-equation-finder
Thanks! I've tried but the functions return approximate values (some are pretty close). I guess I'll have to find values empirically.
Maybe try this then https://www.dcode.fr/function-equation-finder
@hselters: Nice toy!
@yop22:
I've tried but the functions return approximate values (some are pretty close). I guess I'll have to find values empirically.
Why? You got everything you need?
I do not think you really tried to understand as you did not post any details in your results.
Anyhow…
its an expotential function. My 12 Key/Values match 99% exactly.
Here the graph and the formula:
Thanks for your answer but In fact I did try to understand...
Here is a spreadsheet that shows that results of the function dcode.fr evaluated. The 2 first columns are from your first post, the 3rd one is the OSC value calculated with the function and the 4th is the result of the reversed function applied to column 3.
So, basically if I want to set a fader at -3.1dB and I send TM the corresponding calculated value of 0.722227309317561, the fader will be set at -2.4 which, at least for my purpose is too far off.
0.008687576 -63.7 0.0388330949856281 -59.4
0.052125454 -57.3 0.0637221766660042 -55.5
0.09556393 -51.2 0.0929273257445269 -51.2
0.147691 -44.4 0.13329999001333 -45.7
0.19113109 -39.2 0.17096670674684 -41.0
0.24326053 -33.4 0.221438124776892 -35.3
0.2867032 -28.9 0.267892995996373 -30.5
0.33883652 -24 0.327056362337121 -25.1
0.38228348 -20.3 0.378582805194948 -21.0
0.42573345 -17 0.430212160941617 -17.2
0.46918768 -14 0.48233349820052 -13.9
0.5213411 -10.9 0.541950708107921 -10.4
0.5648131 -8.7 0.58815223455548 -8.1
0.60830194 -6.9 0.628553440744174 -6.2
0.6692268 -4.9 0.676376937840514 -4.2
0.7214542 -3.1 0.722227309317561 -2.4
0.7736815 -1.4 0.768127817825816 -0.8
0.8172043 0 0.80792856 0.4
0.8694316 1.7 0.858819904786813 1.9
0.91295445 3.1 0.902948245813648 3.0
0.9564772 4.6 0.952567912519148 4.1
1 6 1.00116967327085 5.2
I might be missing something but that what I came up with.
And again, RME, could you please give the formula ? :-)
I agree, the formula would be useful to have, if it exists.
What are you using to send OSC? Can't you store all values in a table?
I agree, the formula would be useful to have, if it exists.
What are you using to send OSC? Can't you store all values in a table?
I'm using TouchOSC so I could definitely store value pairs in a Lua table but that seems a bit counter intuitive since there must be a secret formula that only RME wizards know
And to be honest I only need a few fixed levels but I would have found it more elegant to be able to choose any level so that's not a big deal.
i extracted a pretty quick fader slide from button to top
and my 3rd post...
https://forum.rme-audio.de/viewtopic.ph … 76#p209576
so - i did not hence about accurancy, or getting thousands values... i just wanted to show you the pinciple.
Get your own values by slowly moving the slider, and then fill in your hundred (or more values) by yoursself. then it will be more accurate.
Its a basic expotential function... used in many audio sw/hw... (logic uses the same btw).
Crying at RME in every post for giving you the "magic"-basic formula, might also help
you can use hexler's potocol for that:
Set scale size in TM to 200%, to get finest resolution.
Connect protocol to one of your TM OSC Controllers.
Hold shift (to get finer resolution) while scrolling slowly with your mouse (wheel) a fader from max to min.
Just did the a test for you with the -2,5 dB:
12:38:34.438 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6Val) STRING(-2.6 dB)
12:38:34.737 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6) FLOAT(0.7379928)
12:38:34.737 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6Val) STRING(-2.6 dB)
12:38:35.140 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6) FLOAT(0.7388633)
12:38:35.140 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6Val) STRING(-2.6 dB)
12:38:35.681 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6) FLOAT(0.73973376)
12:38:35.681 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6Val) STRING(-2.5 dB)
12:38:36.055 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6) FLOAT(0.7406042)
12:38:36.055 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6Val) STRING(-2.5 dB)
12:38:36.597 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6) FLOAT(0.7414746)
12:38:36.597 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6Val) STRING(-2.5 dB)
12:38:37.480 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6) FLOAT(0.7423451)
12:38:37.480 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6Val) STRING(-2.5 dB)
12:38:37.883 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6) FLOAT(0.74321556)
12:38:37.883 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6Val) STRING(-2.4 dB)
12:38:38.035 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6) FLOAT(0.744086)
12:38:38.035 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6Val) STRING(-2.4 dB)
12:38:38.318 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6) FLOAT(0.7449565)
12:38:38.318 | RECEIVE | ENDPOINT([::ffff:127.0.0.1]:56280) ADDRESS(/1/volume6Val) STRING(-2.4 dB)
Hey there guys, I've been trying to implement dB increments for my TotalMix Volume Control project and came across this topic.
I thought I'd share my findings.
Firstly, I captured the float value for dB volumes in increments of 0.5 dB which can all found below for your reference:
0.0 => "-oo"
0.00327084 => "-64.5 dB"
0.0065550446 => "-64.0 dB"
0.0098527325 => "-63.5 dB"
0.013164144 => "-63.0 dB"
0.016489396 => "-62.5 dB"
0.01982873 => "-62.0 dB"
0.023182262 => "-61.5 dB"
0.026550174 => "-61.0 dB"
0.029932702 => "-60.5 dB"
0.033330027 => "-60.0 dB"
0.03674227 => "-59.5 dB"
0.040169723 => "-59.0 dB"
0.043612573 => "-58.5 dB"
0.04707099 => "-58.0 dB"
0.050545223 => "-57.5 dB"
0.054035444 => "-57.0 dB"
0.05754195 => "-56.5 dB"
0.06106487 => "-56.0 dB"
0.06460455 => "-55.5 dB"
0.068161175 => "-55.0 dB"
0.07173498 => "-54.5 dB"
0.07532627 => "-54.0 dB"
0.07893522 => "-53.5 dB"
0.08256213 => "-53.0 dB"
0.08620729 => "-52.5 dB"
0.08987096 => "-52.0 dB"
0.09355347 => "-51.5 dB"
0.09725507 => "-51.0 dB"
0.10097601 => "-50.5 dB"
0.104716696 => "-50.0 dB"
0.10847737 => "-49.5 dB"
0.11225845 => "-49.0 dB"
0.11606017 => "-48.5 dB"
0.11988289 => "-48.0 dB"
0.12372703 => "-47.5 dB"
0.12759289 => "-47.0 dB"
0.13148083 => "-46.5 dB"
0.13539125 => "-46.0 dB"
0.13932459 => "-45.5 dB"
0.14328125 => "-45.0 dB"
0.1472616 => "-44.5 dB"
0.15126605 => "-44.0 dB"
0.15529515 => "-43.5 dB"
0.1593493 => "-43.0 dB"
0.16342893 => "-42.5 dB"
0.16753459 => "-42.0 dB"
0.17166677 => "-41.5 dB"
0.175826 => "-41.0 dB"
0.18001278 => "-40.5 dB"
0.18422768 => "-40.0 dB"
0.18847126 => "-39.5 dB"
0.1927442 => "-39.0 dB"
0.19704697 => "-38.5 dB"
0.20138034 => "-38.0 dB"
0.20574492 => "-37.5 dB"
0.21014136 => "-37.0 dB"
0.21457043 => "-36.5 dB"
0.21903287 => "-36.0 dB"
0.22352935 => "-35.5 dB"
0.22806075 => "-35.0 dB"
0.2326279 => "-34.5 dB"
0.2372316 => "-34.0 dB"
0.24187277 => "-33.5 dB"
0.24655232 => "-33.0 dB"
0.2512713 => "-32.5 dB"
0.25603062 => "-32.0 dB"
0.2608314 => "-31.5 dB"
0.2656747 => "-31.0 dB"
0.27056175 => "-30.5 dB"
0.27549365 => "-30.0 dB"
0.28047168 => "-29.5 dB"
0.28549722 => "-29.0 dB"
0.2905716 => "-28.5 dB"
0.29569635 => "-28.0 dB"
0.3008729 => "-27.5 dB"
0.30610293 => "-27.0 dB"
0.31138808 => "-26.5 dB"
0.31673017 => "-26.0 dB"
0.32213104 => "-25.5 dB"
0.3275927 => "-25.0 dB"
0.33311725 => "-24.5 dB"
0.33870688 => "-24.0 dB"
0.344364 => "-23.5 dB"
0.3500911 => "-23.0 dB"
0.3558908 => "-22.5 dB"
0.361766 => "-22.0 dB"
0.36771968 => "-21.5 dB"
0.37375513 => "-21.0 dB"
0.37987575 => "-20.5 dB"
0.38608524 => "-20.0 dB"
0.39238766 => "-19.5 dB"
0.3987872 => "-19.0 dB"
0.40528864 => "-18.5 dB"
0.4118969 => "-18.0 dB"
0.41861746 => "-17.5 dB"
0.42545626 => "-17.0 dB"
0.43241978 => "-16.5 dB"
0.43951502 => "-16.0 dB"
0.4467498 => "-15.5 dB"
0.45413277 => "-15.0 dB"
0.4616733 => "-14.5 dB"
0.46938202 => "-14.0 dB"
0.47727063 => "-13.5 dB"
0.48535246 => "-13.0 dB"
0.49364233 => "-12.5 dB"
0.5021573 => "-12.0 dB"
0.5109166 => "-11.5 dB"
0.5199427 => "-11.0 dB"
0.5292615 => "-10.5 dB"
0.53890353 => "-10.0 dB"
0.54890496 => "-9.5 dB"
0.5593092 => "-9.0 dB"
0.5701692 => "-8.5 dB"
0.5815507 => "-8.0 dB"
0.5935371 => "-7.5 dB"
0.6062363 => "-7.0 dB"
0.619793 => "-6.5 dB"
0.63440865 => "-6.0 dB"
0.64964163 => "-5.5 dB"
0.6648746 => "-5.0 dB"
0.6801076 => "-4.5 dB"
0.6953405 => "-4.0 dB"
0.71057355 => "-3.5 dB"
0.72580653 => "-3.0 dB"
0.74103945 => "-2.5 dB"
0.7562725 => "-2.0 dB"
0.7715054 => "-1.5 dB"
0.7867384 => "-1.0 dB"
0.8019714 => "-0.5 dB"
0.81720436 => "0.0 dB"
0.83243734 => "0.5 dB"
0.8476703 => "1.0 dB"
0.8629033 => "1.5 dB"
0.8781362 => "2.0 dB"
0.89336926 => "2.5 dB"
0.90860224 => "3.0 dB"
0.92383516 => "3.5 dB"
0.9390682 => "4.0 dB"
0.9543011 => "4.5 dB"
0.9695341 => "5.0 dB"
0.98476714 => "5.5 dB"
1.0 => "6.0 dB"
Based on what I can see, this actually appears to use a square root model for everything up until -6 dB and a linear model from -6 dB to +6 dB.
You can plot this to see exactly what I mean.
After defining two sets of numpy arrays in Python, one for everything up to and including -6.0 dB and one for -6.0 dB - +6.0 dB inclusive, I used the following code to estimate the curves:
import numpy as np
import scipy
x_bottom = np.array(
[
-65.0,
-64.5,
...
-6.5,
-6.0,
]
)
x_top = np.array(
[
-6.0,
-5.5,
...
5.5,
6.0,
]
)
y_bottom = np.array(
[
0.0,
0.00327084,
...
0.619793,
0.63440865,
]
)
y_top = np.array(
[
0.63440865,
0.64964163,
...
0.98476714,
1.0,
]
)
def linear_model(x, a, b):
return m * x + b
def sqrt_model(x, a, b, c):
return a - np.sqrt(b - c * x)
params, covariance = scipy.optimize.curve_fit(sqrt_model, x_bottom, y_bottom)
lparams, lcovariance = scipy.optimize.curve_fit(linear_model, x_top, y_top)
This gave an extremely accurate curve all the way down to 6 decimal places.
Here are the coefficients that were determined and how you could use them if you like:
For the square root curve, we have:
a = 0.8074290817975913
b = -0.03331873487226907
c = 0.01054246851655579
For the linear curve, we have:
a = 0.03046595035384614
b = 0.8172043564
You should then convert the dB value into a float, whereby negative infinity becomes -65.0 and you can then do something like this to calculate the float from the dB value:
if db_float <= -65.0:
estimate = 0.0
elif db_float <= -6.0:
estimate = sqrt_model(
db_float,
a=0.8074290817975913,
b=-0.03331873487226907,
c=0.01054246851655579,
)
else:
estimate = linear_model(db_float, a=0.03046595035384614, b=0.8172043564)
This resulted in values which matched the originals down to 6 decimal places except for just one reading (0.756273 vs 0.756272 which was accurate down to 5 decimal places).
Of course, all this pain could have been avoided if our friends at RME just provided the formula used.
The Fader Curve Calculation is on the comments page in our official documentation:
https://www.rme-audio.de/downloads/osc_ … ix_new.zip
The Fader Curve Calculation is on the comments page in our official documentation:
Oh amazing, thank you so so much!
RME User Forum → TotalMix FX → OSC message in dB ?
Powered by PunBB, supported by Informer Technologies, Inc.