Hey,
I am working on a project that sends OSC messages from PD, and for some reason, when dealing with message lists of mixed objects, such as [send /OSC/blah 0.0 1.0 1.0], PD turns the floating point numbers into int, but only when they represent whole numbers. Can anyone think of a work around where they stay as floating point, or is there some simple solution that I am missing (I can't be bothered to hack up an external just to solve this).
thanks,
db
hi david
pd doesn't distinguish between floats and ints, since all numbers are 32-bit-floats in pd (whereas max/msp DOES distinguish between floats and ints). so what actually happens in your example, is that all numbers are converted to floats (ints are converted to floats, not the other way around). afaict, this shouldn't be a problem as long as you stay in pd. a problem might occur, when you want to send numbers from pd to another app like max/msp. when you want to send '1.0', this is turned to '1' by pd, so the app on the other side might think, it is an int, though it is meant to be a float. i don't know of a nice way yet to overcome this.
roman
On Wed, 2007-02-14 at 08:35 -0500, David Brynjar Franzson wrote:
Hey,
I am working on a project that sends OSC messages from PD, and for some reason, when dealing with message lists of mixed objects, such as [send /OSC/blah 0.0 1.0 1.0], PD turns the floating point numbers into int, but only when they represent whole numbers. Can anyone think of a work around where they stay as floating point, or is there some simple solution that I am missing (I can't be bothered to hack up an external just to solve this).
thanks,
db
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
Hi all,
newer versions of the CNMAT OSC objects or Max implement type tag
strings, which helps to overcome type misinterpretation.
No idea though whether the PD OSC objects at hand understand these
type tags.
greetings, Thomas
Am 14.02.2007 um 15:57 schrieb Roman Haefeli:
hi david
pd doesn't distinguish between floats and ints, since all numbers are 32-bit-floats in pd (whereas max/msp DOES distinguish between
floats and ints). so what actually happens in your example, is that all
numbers are converted to floats (ints are converted to floats, not the other way around). afaict, this shouldn't be a problem as long as you stay in
pd. a problem might occur, when you want to send numbers from pd to
another app like max/msp. when you want to send '1.0', this is turned to
'1' by pd, so the app on the other side might think, it is an int, though
it is meant to be a float. i don't know of a nice way yet to overcome this.roman
On Wed, 2007-02-14 at 08:35 -0500, David Brynjar Franzson wrote:
Hey,
I am working on a project that sends OSC messages from PD, and for some reason, when dealing with message lists of mixed objects,
such as [send /OSC/blah 0.0 1.0 1.0], PD turns the floating point numbers
into int, but only when they represent whole numbers. Can anyone think
of a work around where they stay as floating point, or is there some
simple solution that I am missing (I can't be bothered to hack up an
external just to solve this).thanks,
db
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http:// messenger.yahoo.de
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Thomas Grill http://grrrr.org
David Brynjar Franzson wrote:
Hey,
I am working on a project that sends OSC messages from PD, and for some reason, when dealing with message lists of mixed objects, such as [send /OSC/blah 0.0 1.0 1.0], PD turns the floating point numbers into int, but only when they represent whole numbers. Can anyone think of a work around where they stay as floating point, or is there some simple solution that I am missing (I can't be bothered to hack up an external just to solve this).
The simplest way is to add a very small number to your integers so they don't get turned into floats. I'm going to add some kind of type-forcing mechanism to [packOSC] as soon as I can. Martin
Thank you all for your suggestions.
I'm going to try Frank's patch, but the only sendOSC.c I can find is since 2002, and I cannot find it in any of the code trees. Where does it live nowadays?
db
David Brynjar Franzson wrote:
Thank you all for your suggestions.
I'm going to try Frank's patch, but the only sendOSC.c I can find is since 2002, and I cannot find it in any of the code trees. Where does it live nowadays?
It's in cvs under externals\OSCx\send+dump Martin
We've just had a big discussion about this subject on the OSC list. There is currently no solution for Pd, but perhaps there is something in the works.
http://www.create.ucsb.edu/pipermail/osc_dev/2007-February/thread.html
Steve
On 2/14/07, David Brynjar Franzson david.brynjar@gmail.com wrote:
Hey,
I am working on a project that sends OSC messages from PD, and for some reason, when dealing with message lists of mixed objects, such as [send /OSC/blah 0.0 1.0 1.0], PD turns the floating point numbers into int, but only when they represent whole numbers. Can anyone think of a work around where they stay as floating point, or is there some simple solution that I am missing (I can't be bothered to hack up an external just to solve this).
thanks,
db
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo, David Brynjar Franzson hat gesagt: // David Brynjar Franzson wrote:
I am working on a project that sends OSC messages from PD, and for some reason, when dealing with message lists of mixed objects, such as [send /OSC/blah 0.0 1.0 1.0], PD turns the floating point numbers into int, but only when they represent whole numbers. Can anyone think of a work around where they stay as floating point, or is there some simple solution that I am missing (I can't be bothered to hack up an external just to solve this).
Maybe you can be bothered to make a tiny modification to sendOSC.c as in attached patch and recompile. THis should remove the automatic conversion. Use at your own risk, I didn't test this at all yet.
Frank Barknecht _ ______footils.org_ __goto10.org__
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Maybe you can be bothered to make a tiny modification to sendOSC.c as in attached patch
%&$&§#§$§#!#?, forgot the patch. Why does this always happen at least once every two days?
Frank Barknecht _ ______footils.org_ __goto10.org__
On Wed, Feb 14, 2007 at 05:53:47PM +0100, Frank Barknecht wrote:
%&$&§#§$§#!#?, forgot the patch. Why does this always happen at least once every two days?
Maybe we should hack mutt to search for the string [Aa]ttach and warn the user if there is no attachment before sending!
Chris.
chris@mccormick.cx http://mccormick.cx
alternatively it was suggested that a hacky temporary solution is to add 0.000001 (or something like it) to values, to make them not be automatically converted to int.
ultimately i think a new message for the sendOSC object should be implemented, called "sendtyped", that includes a typestring for expected arguments.
steve
On 2/14/07, Frank Barknecht fbar@footils.org wrote:
Hallo, David Brynjar Franzson hat gesagt: // David Brynjar Franzson wrote:
I am working on a project that sends OSC messages from PD, and for some reason, when dealing with message lists of mixed objects, such as [send /OSC/blah 0.0 1.0 1.0], PD turns the floating point numbers into int, but only when they represent whole numbers. Can anyone think of a work around where they stay as floating point, or is there some simple solution that I am missing (I can't be bothered to hack up an external just to solve this).
Maybe you can be bothered to make a tiny modification to sendOSC.c as in attached patch and recompile. THis should remove the automatic conversion. Use at your own risk, I didn't test this at all yet.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list