How do I Convert db in a scale of 0 to 100 ?

Get help using Construct 2

Post » Sat Sep 23, 2017 10:57 pm

I made a slide bar myself that go from 0 to 100 for controlling the volume of audio, but I see that db goes from -30 to 0... I'm shure there's a way of doing this conversion, but I'm not shure how, anyone can help?

Thanks in advance!!
B
28
S
14
G
6
Posts: 90
Reputation: 5,497

Post » Sun Sep 24, 2017 2:20 am

http://www.blackhornettechnologies.com/Construct2Stuff/Fenix18_volume.capx
The easiest way is to just let the slider do the work for you. Just use your positive reference point (30) and set the slider's Maximum to that. Then juggle the values around to get the negative result.

The volume can go much lower than -30, but it's up to you where you want to stop. You can still here sound at -60, depending on the source.
ImageImageImage
B
72
S
22
G
290
Posts: 3,886
Reputation: 159,513

Post » Sun Sep 24, 2017 5:16 pm

Hey @blackhornet , many thanks man!
I'm wondering what could I use for having a scale from 0 to 100 instead of 0 to 30. Any guess?
B
28
S
14
G
6
Posts: 90
Reputation: 5,497

Post » Sun Sep 24, 2017 6:18 pm

http://www.blackhornettechnologies.com/Construct2Stuff/Fenix18_volume100.capx
OK, but you won't actually here a 1% change, so it's a bit pointless, however, here it is.
ImageImageImage
B
72
S
22
G
290
Posts: 3,886
Reputation: 159,513

Post » Sun Sep 24, 2017 7:05 pm

Cool, you got it! :D
Thank you @blackhornet , I wish you all the best! Be blessed.

For you that may need, the formula is:
-(MinDB-(SliderBar.Value/MaxRef)*MinDB)
B
28
S
14
G
6
Posts: 90
Reputation: 5,497


Return to How do I....?

Who is online

Users browsing this forum: mumu64 and 1 guest