converting floating point to LSB MSB

Hello,

I have a (OSCin) signed floating point value between 0 and 1

that needs to be converted to LSB and MSB values as a 2 byte value for DMX out …

How can I do this?

Thnx to help,

Jan

What range are the floating point numbers?
What range are the 2-byte DMX values?

If you want to map 0…1 onto 0…65535 (unsigned 2-bytes), then you could for example, use the expressions, to map a (0…1) onto two values representing 2 byte unsigned value:

int( min( max(a,0), 1) * 65535) %256
int( min( max(a,0), 1) * 65535) / 256

The 0,1 values, are clamping values above.

This could be done with expressions above, or more quickly with Math and Limit CHOPs.

Hope that helps,
Rob.

The range of the float is 0 to 1 signed
The output MSB Byte and LSB

I did managed to follow the last part, as you did suggest. But I still have no clue how to manage the signed float to unsigned integer.

At this moment my object is rotating well in unity. But in touchdesigner he is only going upto 180 degrees and then then counts down again.

It seems that from 0 to 180 degrees the float add from 0 to 1
and from 180 to 360 degrees subtracts from 1 to 0

Also I have decimals in the express2 …
OSC touchDesigner JeffoTSTSSD.7.toe (4.19 KB)