Old 08-07-2019, 10:12 AM   #1
Amether
Human being with feelings
 
Amether's Avatar
 
Join Date: Apr 2006
Location: London
Posts: 505
Default Volume adjustments - 2^(x/6) vs 10^(x/20)?

If I sneak a look at some JS plugins, they tend to use the formula 2^(x/6) to convert a slider that gives an dB adjustment of x to a multiplier for each sample.

Why is this used and not 10^(x/20)?

As I understand it, this 10^(x/20) is more 'correct'? (source: http://www.sengpielaudio.com/calculator-levelchange.htm)

I appreciate the values turn out very similar until you reach such huge changes in volume that it kinda doesn't matter, but y'know, still. What's the reasoning behind this? CPU?
__________________
My name's Martin ... phone ... Martin Phone! http://soundcloud.com/martin-phone
Amether is offline   Reply With Quote
Old 08-07-2019, 10:22 AM   #2
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 17,917
Default

>>> https://forum.cockos.com/showthread.php?t=221913
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 08-07-2019, 11:07 AM   #3
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,174
Default

2^(x/6) is an approximation.
schwa is offline   Reply With Quote
Old 08-08-2019, 12:29 AM   #4
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,954
Default

At some point 2^x might have been more efficient, in which case the approximation makes sense. However, nowadays 2^x and 10^x are just as (in)efficient. A slightly more efficient aproach would be exp(x*y), where y = log(10)/20.
Tale is offline   Reply With Quote
Old 08-08-2019, 09:32 AM   #5
Amether
Human being with feelings
 
Amether's Avatar
 
Join Date: Apr 2006
Location: London
Posts: 505
Default

Thanks all - I did search but clearly need better search skillz... sigh. I choose... inefficient!
__________________
My name's Martin ... phone ... Martin Phone! http://soundcloud.com/martin-phone
Amether is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.