vMix Forums
»
General
»
3rd Party Software and Development
»
What's the maths behind Logarithmic audio levels?
Rank: Member
Groups: Registered
Joined: 8/5/2015(UTC) Posts: 12 Location: Milton Keynes,UK
Thanks: 3 times
|
When the API for audio levels changed to logarithmic, and the option to still use linear disappeared, I had to rewrite our panel interace to VMIX to cope with the logarithmic values.
To explain, API going out that changes audio fader values is still linear and integer, but the API values that show current settings is now only logarithmic. Both are values 0-100, the logarithmic values give fine control over small values at low slider positions.
I could not work out the maths, it did not seem to be any standard log function curve. I'm no mathematician, but I tried different number bases, to no avail. It's almost like you're doing a log of a log, or something.
The lower values especially seem to be far lower than I would have expected. None of which would be a problem except my formulae for log to linear didn't match. I ended up building a table of values in steps of 5, hardcoding the 1st 16 values, and interpolating the values between those steps... it works, sort of, but would be better to put in the right algorithm, and maybe useful to other developers.
Thanks
Geoff.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 2/27/2013(UTC) Posts: 312 Thanks: 8 times Was thanked: 78 time(s) in 43 post(s)
|
This was a head scratcher for me as well. You need to multiply the value of the integer that is between 0 and 1 to the power of .25. For instance, if the value is .5, you would raise it to the .25 power and you would get .84 or 84%. 1 to the .25 power is 1 and 0 to the .25 power is 0. That ends up being your curve. Hope that helps!
-Seth
|
1 user thanked thecloudmediagroup for this useful post.
|
|
|
Rank: Member
Groups: Registered
Joined: 8/5/2015(UTC) Posts: 12 Location: Milton Keynes,UK
Thanks: 3 times
|
Of course.. that's why I could see powers of 25 in the values.
Many thanks Geoff.
|
|
|
|
vMix Forums
»
General
»
3rd Party Software and Development
»
What's the maths behind Logarithmic audio levels?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close