[PD] Floats and negative numbers over OSC

PSPunch shima at pspunch.com
Wed Jul 7 17:00:45 CEST 2010


Hi Martin,



So I guess it is likely to be a problem with GlovePIE not formatting the 
bytes according to the OSC specifications..
I will review the OSC format and if necessary, inform the author.


Thanks again for investigating.

-- 
David Shimamoto


> PSPunch wrote:
>>
>> Hi Martin,
>>
>>
>> Thank you for your response.
>>
>> I am attaching the patch used to produce the following results.
>>
>> This was tested on
>> Pd version 0.41.4-extended,
>> running on WinXP SP3.
>>
>>
>> The OSC data were sent by GlovePIE running the following code.
>>
>> -------
>> SendOSC("127.0.0.1", 9997, "/test", 0)
>> wait 1 second
>> SendOSC("127.0.0.1", 9997, "/test", 1.5)
>> wait 1 second
>> SendOSC("127.0.0.1", 9997, "/test", -1)
>> wait 1 second
>> -------
>>
>>
>>
>>
>> I was expecting [routeOSC] to output 0, 1.5, -1.
>>
>>
>> --- Output ---
>>
>> raw: 47 116 101 115 116 0 0 0 44 105 0 0 0 0 0 0
>> unpacked: /test 0
>> routed: 0
>>
>> raw: 47 116 101 115 116 0 0 0 44 102 0 0 63 63 0 0
>> unpacked: /test 0.746094
>> routed: 0.746094
>>
>> raw: 47 116 101 115 116 0 0 0 44 105 0 0 63 63 63 63
>> unpacked: /test 1.06111e+009
>> routed: 1.06111e+009
>>
>>
>
> Hmmm, if I try sending the same values from packOSC to routeOSC I get:
>
> routed: 0
> unpacked: /test 0
> raw: 47 116 101 115 116 0 0 0 44 105 0 0 0 0 0 0
> routed: 1.5
> unpacked: /test 1.5
> raw: 47 116 101 115 116 0 0 0 44 102 0 0 63 192 0 0
> routed: -1
> unpacked: /test -1
> raw: 47 116 101 115 116 0 0 0 44 105 0 0 255 255 255 255
>
> It looks like GlovePIE is sending the wrong numbers. Does it send
> anything except 63 for a value? The integer -1 should be 255 255 255
> 255, or 4294967295 (32 ones), but your device is sending 1061109567, as
> though the two most significant bits of each byte are being set to zero.
>
>
> Martin
>
>




More information about the Pd-list mailing list