- Posts: 133
- Thank you received: 5
This is the optional category header for the Suggestion Box.
rounding / padding
- Sat32
- Topic Author
- Offline
- User
-
Less
More
1 year 10 months ago #3269
by Sat32
rounding / padding was created by Sat32
Working on a volume display and value keeps bouncing around is there a math rounding function or a way to pad a result?
Thanks
Thanks
Please Log in to join the conversation.
- davep
- Offline
- Admin
-
Less
More
- Posts: 367
- Thank you received: 96
1 year 10 months ago #3270
by davep
Replied by davep on topic rounding / padding
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 to join the conversation.
- Sat32
- Topic Author
- Offline
- User
-
Less
More
- Posts: 133
- Thank you received: 5
1 year 10 months ago #3271
by Sat32
Replied by Sat32 on topic rounding / padding
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
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 to join the conversation.
- Nillaz
- Offline
- User
-
Less
More
- Posts: 443
- Thank you received: 36
1 year 10 months ago #3272
by Nillaz
Replied by Nillaz on topic rounding / padding
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 to join the conversation.
- Sat32
- Topic Author
- Offline
- User
-
Less
More
- Posts: 133
- Thank you received: 5
1 year 10 months ago #3275
by Sat32
Thanks
Replied by Sat32 on topic rounding / padding
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 driverThe 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.
Thanks
Please Log in to join the conversation.
- Nillaz
- Offline
- User
-
Less
More
- Posts: 443
- Thank you received: 36
1 year 10 months ago #3276
by Nillaz
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.
Replied by Nillaz on topic rounding / padding
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.
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 driverThe 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.
Thanks
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 to join the conversation.
Time to create page: 0.190 seconds