Hi Clint,
I looked at this and it is do-able but you must use maths to achieve it and some formatting to keep the result small because log calculations can produce large numbers of decimal places. In the Control Curves there are formulas that you can adapt to use for this. The equation I am referring to is this one
pow(10, (log(x, 10) * slope - (log(zeroDbPos, 10) * slope)) / 20)
taken from the “New” curve file. It produces a scalar output, meaning 0.000 to 1.000 would be the output range. This could be used to build an expression but require another conversion using the “to dB(x)” built in function so to simplify I stripped the equation down.
The relevant part of the equation required is
(log(x, 10) * slope - (log(zeroDbPos, 10) * slope)
where x = cc(number,channel)
and where zeroDbPos = 96 and slope = 60 , note these values are also shown in the control curve file as declared constants.
filling in the equation for a standard CC number value looks like this (notice the section cc(7,2) represents cc 7 on channel 2).
log(cc(7,2),10)*60 - (log(96,10) * 60
This also needs formatting because it makes long number outputs so when you make the string statement you add a formatting element to the script like this where the part of the expression “N1” forces to a single decimal place.
$(formatNumber(log(cc(7,2),10)*60 - (log(96,10) * 60),"N1"))
Then to dress it up you can add the prefix and suffix parts using conditional expressions.
$(cc(7,2) > 96 ? "+": " ")$(formatNumber(log(cc(7,2),10)*60 - (log(96,10) * 60),"N1")) $(cc(7,2) > 0 ? "dB" : " " )
The prefix adds the + sign when you exceed 0 db and the suffix adds the “dB” except when at value ∝.
Here it is shown on a Controller Bar button.
I think this ought to do it for your setup or anyone who wants to display this type of info. Let me know if it works for you.
Dave