put a level to hex value
Germt
Posts: 10
Hello
Iam trying to put a level from 0 to 255 to use into a string that have to be in hex.
The value i have to send in hex is beteen -79 to +12.
I don't know how to do it, because it is all new for me.
Can someone tell me how i can do it.
txxs
Iam trying to put a level from 0 to 255 to use into a string that have to be in hex.
The value i have to send in hex is beteen -79 to +12.
I don't know how to do it, because it is all new for me.
Can someone tell me how i can do it.
txxs
0
Comments
If NValue =100, this will be interpreted as sending a hex 64... "$64" in AMX speak.
Sends literal hex. The device will receive '64'
Let's see if my math skills still work...
$-79 to $12 is $8C steps, I think... (140 decimal)
255=$FF. (fader goes from 0 to 255)
So incoming volume = nvol
nvol=nvol+79 // (make it a positive scale)
fader_value=(nvol / $8C) * $FF
Now you can change the touch panels fader range in TPD4 as well. That uses less math. I personally like to leave my faders default on the panel. the math doesn't scare me and it keeps me honest.