Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
translations translations
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Volume percent
« previous next »
  • Print
Pages: [1]

Author Topic: Volume percent  (Read 3875 times)

Offline Logg

  • Member
  • *
  • Posts: 5
Volume percent
« on: November 19, 2009, 08:21:32 PM »
This is what I have right now:

Code: [Select]
%?pv<0.0|1.5|3.1|4.6|6.2|7.7|9.2|10.8|12.3|13.8|15.4|16.9|18.5|20.0|21.5|23.1|24.6|26.2|27.7|29.2|30.8|32.3|33.8|35.4|36.9|38.5|40.0|41.5|43.1|44.6|46.2|47.7|49.2|50.8|52.3|53.8|55.4|56.9|58.5|60.0|61.5|63.1|64.6|66.2|67.7|69.2|70.8|72.3|73.8|75.4|76.9|78.5|80.0|81.5|83.1|84.6|86.2|87.7|89.2|90.8|Way Too Loud>%%
Which works great, except it will only work if there are 58 places below 0dB and 6 above and I can't display percentages for decibels greater than zero. Is there a better way to do this?

In attempt to comply with forum rule 5.5, I am including this next block.
Note to future: This post written November 19th, 2009; Rockbox 3.4 was the latest build.  If answer here is no, it's possible that the answer is now yes. If the answer is still no, and you found this page while looking for the same solution and there are not 58 places below 0db and 6 above; then you can generate an appropriate list with this python 2.6 script:
Code: [Select]
def percent():
    x=0
    g=0
    string=""
    while g<=59: #change 59 to your amount below 1dB
        string=string+str(round(x,1))+"|"
        x=x+100.0/65.0 #change the denominator here to total amount of possible volume settings
        g+=1
    print string #If you're in python 3, print statement is now a function
percent()
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Volume percent
« Reply #1 on: November 19, 2009, 08:28:19 PM »
You wouldn't want to go above 0 anyway. >0dB means that you'll get clipping, among other things.

There is not a better way to do this, and honestly "percentage" doesn't make a whole lot of sense. Volume counts down from the level the file is recorded at, where yours says 40.0%, that's not a percentage *of* anything. It's just a made up number you're using.
Logged

Offline Logg

  • Member
  • *
  • Posts: 5
Re: Volume percent
« Reply #2 on: November 19, 2009, 08:31:51 PM »
It's a percentage of maximum possible volume, and while you would never want to go above 0dB since it would likely damage the headphones, it seems wrong to leave it as is.
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 9376
Re: Volume percent
« Reply #3 on: November 19, 2009, 08:37:27 PM »
Quote from: Logg on November 19, 2009, 08:31:51 PM
It's a percentage of maximum possible volume,

Actually no, at least not the way you're doing it.  dB are a logarithmic scale, so " x=x+100.0/65.0" is definitely not giving you percent of the maximum. If you want to do percentage of the maximum, -10dB is 10%, -20dB is 1%, -30dB 0.1% and so on. 
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Volume percent
« Reply #4 on: November 19, 2009, 08:38:25 PM »
Volume counts down. One one player 0dB is 74 units from the minimum. On another it's 58. On some you can go above 0db, on others you cannot.

Why use "percentage" if it's just making up things? Why not just reverse the scale so that it counts from 0 up to 58? Percentage offers no useful information at all, you're just making up a pretend scale to use instead of a real scale.
Logged

Offline Logg

  • Member
  • *
  • Posts: 5
Re: Volume percent
« Reply #5 on: November 19, 2009, 08:50:02 PM »
Quote from: saratoga on November 19, 2009, 08:37:27 PM
Actually no, at least not the way you're doing it.  dB are a logarithmic scale, so " x=x+100.0/65.0" is definitely not giving you percent of the maximum. If you want to do percentage of the maximum, -10dB is 10%, -20dB is 1%, -30dB 0.1% and so on. 

You're right. It's not a percentage of possible maximum volume, it's a percentage of possible maximum volume setting. At least, that's how I interpreted your post.
« Last Edit: November 19, 2009, 08:57:06 PM by Logg »
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Volume percent
« Reply #6 on: November 19, 2009, 08:55:29 PM »
So why are you trying to make the value confusing by presenting it as an arbitrary and virtually meaningless number?
Logged

Offline Logg

  • Member
  • *
  • Posts: 5
Re: Volume percent
« Reply #7 on: November 19, 2009, 08:57:49 PM »
Quote from: Llorean on November 19, 2009, 08:55:29 PM
So why are you trying to make the value confusing by presenting it as an arbitrary and virtually meaningless number?

It's for personal use, so I don't have to worry about it not working for another person. I'm modifying the theme listed at the end of this sentence, and wanted a scale that I found more useful to me.  http://themes.rockbox.org/themes/320x240/too_much_information/wps-wps.png

In any case, thanks to both of you for answering my question.
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Volume percent
« Reply #8 on: November 19, 2009, 09:12:31 PM »
In what way is a fake percentage "useful" then? If there's a valid use for it, it might deserve a real tag, but nobody's really provided one yet. You said it's more useful for you. Do you just mean "more aesthetic to me" or do you find an actual use for it?
Logged

Offline Logg

  • Member
  • *
  • Posts: 5
Re: Volume percent
« Reply #9 on: November 19, 2009, 09:21:52 PM »
Quote from: Llorean on November 19, 2009, 09:12:31 PM
In what way is a fake percentage "useful" then? If there's a valid use for it, it might deserve a real tag, but nobody's really provided one yet. You said it's more useful for you. Do you just mean "more aesthetic to me" or do you find an actual use for it?

I'm not familiar with dB, so from your perspective, it may be ironic that that the dB measurement is arbitrary from my perspective. Since not all of my music tracks are recorded at the same volume, and I don't know the specific volume of which each track is recorded at, and since I can personally hear in real-time what the current volume is; I have always imagined the slider as an indicator of volume limit. This percentage scale I've created for myself replaces what I've lost in the slider while keeping it in text form.
Logged

Offline Multiplex

  • Member
  • *
  • Posts: 442
Re: Volume percent
« Reply #10 on: November 20, 2009, 07:38:48 AM »
Quote from: Logg on November 19, 2009, 09:21:52 PM
Since not all of my music tracks are recorded at the same volume...
Maybe Replay Gain is what you need - in the manual and/or Wiki - to make them all the same (it uses tags to automatically alter the volume - kind of)
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Volume percent
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.054 seconds with 15 queries.