Re: [PD] Floats and negative numbers over OSC

2010-07-07 Thread PSPunch


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





___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Floats and negative numbers over OSC

2010-02-01 Thread Georg Werner

hi,

thanks a lot - that made it clear to me.
g.

IOhannes m zmoelnig schrieb:

Georg Werner wrote:

Hi,

i tried your patch on winxp just with udpsend and had the same problems:
error: udpsend_send: item 0 (-1.00) is not between 0 and 255
error: udpsend_send: item 0 (1.10) is not an integer
so maybe the problem is not OSC but UDP? as it seems to handle only
single bytes.
So my question how to send a -1.1 over UDP?
g.


haven't looked at the patch, but there are two possible reasons for this:
- somebody (the patch?) is injecting non-byte-values into the data to
udpsend. udpsend takes a list of bytes, not a Pd message. this means:
you cannot just send the message /test -1 to udpsend, you need an
object inbetween that translates the message /test -1 into a binary
format. [packOSC] is one such object which will translate the given
message into a list of bytes 47 116 101 115 116 0 0 0 44 105 0 0 255
255 255 255 (all atoms are floats and the values are integer and
between [0, 255]).
 [udpsend] is NOT a drop-in replacement for [netsend 1]!

- very old(!) versions of [udpsend] (or was it [udpreceive]?) had a
problem with signed/unsignedness, resulting in 255 (binary  in
unsigned)  being interpreted as -1 (binary  in signed). if
this is the case, you have to upgrade udpsend/receive (e.g. install a
newer stable release of Pd-extended)


gfmasdr
IOhannes


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Floats and negative numbers over OSC

2010-01-31 Thread PSPunch


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



Thank you again for your help.

--
David Shimamoto





PSPunch wrote:


Hi Calude,


 I don't know if mrpeach osc and net objects work on Windows, but if
they
 do they should be preferred to the OSCx objects.
 (snip)
 OSCx library is old, buggy, unmaintained, broken

I've tried the two libraries prior to my post.
They both work well on Windows to the extent that I saw neither having
disadvantages over the other.


A problem I see commonly among the two mentioned sets of libraries is
that they output incorrect values when receiving float or negatives.
Integers and zero are fine.


Recent versions of [packOSC] and [unpackOSC] should work properly.
If not, please post some examples.

Martin

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -
http://lists.puredata.info/listinfo/pd-list





routeOSC-test.pd
Description: application/puredata
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Floats and negative numbers over OSC

2010-01-31 Thread Martin Peach

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


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Floats and negative numbers over OSC

2010-01-31 Thread PSPunch


Hi Martin,


So it seems like a problem with GlovePIE not formatting the bytes 
according to the OSC specs..


I will review the format and if find it relevant, contact 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





___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


[PD] Floats and negative numbers over OSC

2010-01-30 Thread PSPunch

Hi,


Can someone advise me on the current state of receiving floats and
negative numbers over OSC? (on Windows)

It seems like both [dumpOSC] and [routeOSC] treats the 4 byte input as
an integer, ignoring the format.

I've looked through the log but found only similar voices and no solution..


Thanks in advance.

-- 
David Shimamoto

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Floats and negative numbers over OSC

2010-01-30 Thread Claude Heiland-Allen

PSPunch wrote:

Hi,


Hi,


Can someone advise me on the current state of receiving floats and
negative numbers over OSC? (on Windows)


I don't know if mrpeach osc and net objects work on Windows, but if they 
do they should be preferred to the OSCx objects.


Someone could/should make abstractions to replace the OSCx objects using 
mrpeach objects.



It seems like both [dumpOSC] and [routeOSC] treats the 4 byte input as
an integer, ignoring the format.


OSCx library is old, buggy, unmaintained, broken


I've looked through the log but found only similar voices and no solution..


mrpeach osc and net objects


Claude

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Floats and negative numbers over OSC

2010-01-30 Thread PSPunch


Hi Calude,


 I don't know if mrpeach osc and net objects work on Windows, but if they
 do they should be preferred to the OSCx objects.
 (snip)
 OSCx library is old, buggy, unmaintained, broken

I've tried the two libraries prior to my post.
They both work well on Windows to the extent that I saw neither having 
disadvantages over the other.


(Not to say that I intend to ignore warnings on avoiding OSCx.. just 
mentioning it for historical logging.)



A problem I see commonly among the two mentioned sets of libraries is 
that they output incorrect values when receiving float or negatives. 
Integers and zero are fine.



Can anyone share experience or workarounds before I go reinvent some 
more wheels?



--
David Shimamoto

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Floats and negative numbers over OSC

2010-01-30 Thread Martin Peach

PSPunch wrote:


Hi Calude,


  I don't know if mrpeach osc and net objects work on Windows, but if they
  do they should be preferred to the OSCx objects.
  (snip)
  OSCx library is old, buggy, unmaintained, broken

I've tried the two libraries prior to my post.
They both work well on Windows to the extent that I saw neither having 
disadvantages over the other.



A problem I see commonly among the two mentioned sets of libraries is 
that they output incorrect values when receiving float or negatives. 
Integers and zero are fine.


Recent versions of [packOSC] and [unpackOSC] should work properly.
If not, please post some examples.

Martin

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list