Followers
0
Following
0
Joined
Last Online
-
pmoney
I've been using this method. You use expr in this format.
[expr (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin]
When mapping ctl values in, I often start by mapping to the range -1 to 1 which would look like this.
[expr ((($f1 - 0) * (1 - -1)) / (127 - 0)) + -1]
That'll take whatever the ctl value (1-127) coming in and convert it to the rage of -1 to 1. The old min and old max are the min and max of the data coming in and the new min and max represent the range of the values you want.
Hope that helps.