Your Universal Remote Control Center
RemoteCentral.com
Custom Installers' Lounge Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
I need some math formula help for two way feedback
This thread has 8 replies. Displaying all posts.
Post 1 made on Tuesday January 3, 2012 at 12:24
AnthonyZ
Select Member
Joined:
Posts:
September 2005
1,987
Hey nerds, I need some math help. I feel like an idiot but, I can't figure this out. I am writing some JavaScript for two way feedback for a Parasound preamp. Volume scale runs from decimal 10 = 0% to 106 = 100% or .96/step. I want to convert to 0-100% scale in the GUI but, I am too stupid to figure out the math. I can write the script (parse hex and ASCII, yes both > convert to decimal > apply formula), I just don't understand what the formula needs to be. Can some one help me out?
"Just when I thought that I was out they pull me back in"
Post 2 made on Tuesday January 3, 2012 at 12:40
highfigh
Loyal Member
Joined:
Posts:
September 2004
8,192
On January 3, 2012 at 12:24, AnthonyZ said...
Hey nerds, I need some math help. I feel like an idiot but, I can't figure this out. I am writing some JavaScript for two way feedback for a Parasound preamp. Volume scale runs from decimal 10 = 0% to 106 = 100% or .96/step. I want to convert to 0-100% scale in the GUI but, I am too stupid to figure out the math. I can write the script (parse hex and ASCII, yes both > convert to decimal > apply formula), I just don't understand what the formula needs to be. Can some one help me out?

Why not start at 106 = 100 and not bother with the difference at the low end? That little bit of "on" volume setting isn't useful, anyway.
My mechanic told me, "I couldn't repair your brakes, so I made your horn louder."
Post 3 made on Tuesday January 3, 2012 at 12:50
jimstolz76
Loyal Member
Joined:
Posts:
December 2007
5,607
Subtract 10 and call decimal 96 as the highest level?

Feedback -- percent
10 ( -10) == 0%
50 ( -10) == 40%
106 ( -10) == 96%

Ever going to go above 96%?

I know it's driving you crazy to not be able to do it the 'right' way, though...lol.... but the scale will be accurate, you will just never get that top 4%.
OP | Post 4 made on Tuesday January 3, 2012 at 12:50
AnthonyZ
Select Member
Joined:
Posts:
September 2005
1,987
Accuracy and proper scaling. If I ignore the difference on the low end, the scale will be off throughout the range. That and I just want to understand the flippin' math (not a strong suit).
"Just when I thought that I was out they pull me back in"
Post 5 made on Tuesday January 3, 2012 at 13:00
brucelee
Long Time Member
Joined:
Posts:
July 2005
100
Scaled Volume = (Reported Volume - 10) / .96

Bruce
Post 6 made on Tuesday January 3, 2012 at 13:00
jimstolz76
Loyal Member
Joined:
Posts:
December 2007
5,607
Thought about it again.

Subtract 10 from the decimal feedback
Divide that number by 96

Gives you a full percentage range from 0% - 100%. It's about 1.04% ~ 1.05% between each step.
OP | Post 7 made on Tuesday January 3, 2012 at 13:05
AnthonyZ
Select Member
Joined:
Posts:
September 2005
1,987
Thank you gentlemen. That's what I needed. Glad I can count on other's brains around here.
"Just when I thought that I was out they pull me back in"
Post 8 made on Wednesday January 4, 2012 at 10:14
Mario
Loyal Member
Joined:
Posts:
November 2006
5,680
On January 3, 2012 at 13:05, AnthonyZ said...
Thank you gentlemen. That's what I needed. Glad I can count on other's brains around here.

That's just it Anthony; you can't count  :-)
OP | Post 9 made on Wednesday January 4, 2012 at 22:26
AnthonyZ
Select Member
Joined:
Posts:
September 2005
1,987
On January 4, 2012 at 10:14, Mario said...
That's just it Anthony; you can't count  :-)

D'oh!
"Just when I thought that I was out they pull me back in"


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse