UDP and double precision values

CarlEmail's icon

Dear forum

How do I send and receive double precision floating point (double 64bit) and integer (long 64bit) values using UdpSend and UdpReceive?

The flonum object can display up to 52 digits (only 16 is needed for double though) but the actual output of the object is capped at 5 digits.

A solution where the value is wrapped in a string (symbol) is not accepted, because I need to detect the double data type automatically in the receiving end.

Any ideas?

Carl Emil

hz37's icon

I think the free CNMAT OSC objects do support this (udpsend and receive are subsets of the CNMAT OSC implementation). OSC supports 64 bit integers and floating point data:

CarlEmail's icon

I have just tested CNMAT's OpenSoundControl object and both double (float64 with tag 'd') and long (int64 with tag 'h') is received consistently as 0.0. Also char (with type tag 'c') is received as non-interpreted asci code (integer). In constrast, the oscP5 library in Processing understands the type tags fine, so it is not a problem on the sending side, which is the library OSCSharp for Unity.

No worky.

Roman Thilenius's icon

if you need to detect the type of something wrapped into a symbol, you can do that using prefixes via append/route:

symbol float64 7,5555555

[fromsymbol]

[route float64 int64 specialcommand uselessdata]

Luke Woodbury's icon

I don't know if Adam Siska's UDP externals will help, they can deal with raw UDP comms rather than OSC specific:

CarlEmail's icon

Prefixes via append/route won't help, because the osc tag data is already parsed when it exits udpreceive. Adam Siska’s UDP externals looks pretty kool, but that would require me to essentitally write my own OSC implementation.

metamax's icon

You can pack the float in a matrix. Like this...

Max Patch
Copy patch and select New From Clipboard in Max.

CarlEmail's icon

Great tip, and it will work fine between Max applications in controlled cases – but the value will be send without type tag, so it won't be recognised by OSC implementations.

vigliensoni's icon

Hi everyone, has someone found a solution to this?

Source Audio's icon

..........