embarrassing
PyroGuy
Posts: 121
Ok - no such thing as a dumb question but...
What is the trick to converting a FLOAT to Integer? I need to convert a level conversion value which is is returning 4 decimal accuracy but need only the integer value to send the the Autopatch router.
Define_Variable
FLOAT Vol
FLOAT Vol2
Define_Event
...
Vol2 = ((Vol / 3.1875) -70)
Vol3 = (Vol2*10)
SEND_STRING dvAswitch, "'CO9VA',ItoA(vol3),'T'"
I am feeling really dumb right now - and it's really late!.
Thanks for not snickering (out loud!)
What is the trick to converting a FLOAT to Integer? I need to convert a level conversion value which is is returning 4 decimal accuracy but need only the integer value to send the the Autopatch router.
Define_Variable
FLOAT Vol
FLOAT Vol2
Define_Event
...
Vol2 = ((Vol / 3.1875) -70)
Vol3 = (Vol2*10)
SEND_STRING dvAswitch, "'CO9VA',ItoA(vol3),'T'"
I am feeling really dumb right now - and it's really late!.
Thanks for not snickering (out loud!)
0
Comments
You might need to do a TYPE_CAST() to avoid compiler warnings.
Jeff
(silently snickering)
Why are you doing this? If its an Autopatch switch then you shouldn't need to do any volume arithmetic at all as it is done in the module.
Paul
Jeff
Interesting. I am using the autopatch module right now and the only thing it is missing is the eq stuff that should get added sometime soon. So far it has worked really well, so I am not sure why you would need to rebuild it. All the volume arithmetic is done for me so that my volume feedback has a level in the range of 0-255 and I just send it the level.value of the virtual output volume.
Paul
The command requires a value which was being created when converting from a level (0-255) to a db value for the switcher (Vol / 3.1875) -70) which was something I learned from a previous post. (AP ranges from -70db to +10db)
Some subsequent playing around seems to indicate that the Autopatch could care less about the decimal value and it seems to work as I have it coded...
Vol2 = ((Vol / 3.1875) -70)
Vol3 = (Vol2*10)
SEND_STRING dvAswitch, "'CO9VA',ItoA(vol3),'T'"
Go figure - but it's nice to think you are wrong and find out that it works anyway!
Cheers!