This is the optional category header for the Suggestion Box.

rounding / padding

Sat32's Avatar Topic Author
User User
  • Posts: 133
  • Thanks: 5

rounding / padding

2 years 1 hour ago
#3269
Working on a volume display and value keeps bouncing around is there a math rounding function or a way to pad a result?

Thanks

Please Log in or Create an account to join the conversation.

davep's Avatar
Admin Admin
  • Posts: 371
  • Thanks: 98

Re: rounding / padding

2 years 52 minutes ago
#3270
What driver is being used? What volume variable is being used for tracking?  Some driver have strange volume values that are measured in db. The drivers have to translate them in a 0.100% for the sliders. There can be some slight rounding errors but a constant input value should result in a consistent server variable value. I'll have a better explaination once I know what driver is in play.

Please Log in or Create an account to join the conversation.

Sat32's Avatar Topic Author
User User
  • Posts: 133
  • Thanks: 5

Re: rounding / padding

2 years 34 minutes ago
#3271
It's marantz the volume range displayed is -80 to 12.5. I used this:

Math|Subtract~uv_{{livingroom_sr5011_id}}_vol-range~12.5~-80!
Math|Subtract~uv_{{livingroom_sr5011_id}}_vol-start~{{av_{{livingroom_sr5011_id}}_volume}}~-80!
Math|Multiply~uv_{{livingroom_sr5011_id}}_vol-corrected~{{uv_{{livingroom_sr5011_id}}_vol-start}}~100!
Math|Divide~uv_{{livingroom_sr5011_id}}_vol-percentage~{{uv_{{livingroom_sr5011_id}}_vol-corrected}}~{{uv_{{livingroom_sr5011_id}}_vol-range}}!

to convert it to a percentage so I could use a progress bar but after playing around with the gui decided to emulate the look of the reciever and pull the value right from the driver. The value is displayed like -50.5 then will step to -50 to -49.5 causing it bounce around if centered left aligning helps but still doesn't look right

Thanks

Please Log in or Create an account to join the conversation.

Nillaz's Avatar
User User
  • Posts: 444
  • Thanks: 36

Re: rounding / padding

1 year 11 months ago
#3272
The Denon driver used to do the same but Dave was able to modify it so it showed integer values with the decimal, so -50 displayed as -50.0 and it fixed the problem entirely.

Please Log in or Create an account to join the conversation.

Sat32's Avatar Topic Author
User User
  • Posts: 133
  • Thanks: 5

Re: rounding / padding

1 year 11 months ago
#3275
The Denon driver used to do the same but Dave was able to modify it so it showed integer values with the decimal, so -50 displayed as -50.0 and it fixed the problem entirely.
 
After I saw your post I was hoping there would be a new driver available when I got home from work. Anyways Dave deserves sometime away from fixing problems like this. I am a little surprised that Allonis didn't combine Denon and Marantz into a single driver
Thanks

Please Log in or Create an account to join the conversation.

Nillaz's Avatar
User User
  • Posts: 444
  • Thanks: 36

Re: rounding / padding

1 year 11 months ago
#3276
The Denon driver used to do the same but Dave was able to modify it so it showed integer values with the decimal, so -50 displayed as -50.0 and it fixed the problem entirely.

 
After I saw your post I was hoping there would be a new driver available when I got home from work. Anyways Dave deserves sometime away from fixing problems like this. I am a little surprised that Allonis didn't combine Denon and Marantz into a single driver
Thanks
 
I'm actually a little surprised that the Marantz driver doesn't do this already. I thought that all drivers had been modified to append trailing zeros to the volume variables.

I assume there's technical reasons for keeping them separate despite all that they share/have in common, but that's beyond my pay grade.

Please Log in or Create an account to join the conversation.

Time to create page: 0.317 seconds