Corona SDK Volume Sliders

If you are developing mobile apps with Corona SDK that use volume controls, here’s a quick tip for implementing more natural feeling controls. ¬†Assuming that the control is a slider with values from 0 to 100, all it takes is one line of code:

volume = (math.pow(3,sliderValue/100)-1)/2

But since I really like seeing things work myself, I’ve built a very small demo project that you can download and run:
screenshot
VolumeSliders.zip

If you would like to read more on why this formula works or why it’s even needed, this page may be interesting for you:¬†http://www.dr-lex.be/info-stuff/volumecontrols.html