[PD] Sending negative numbers over OSC

Martin Peach martinrp at vax2.concordia.ca
Fri Dec 19 18:41:18 CET 2003

In your original post you said
"it occured to me, that sending negative floats over OSC doesn't work
... I admit I never tried it myself before 'fixing' it, but it still 

Perhaps in the longer term it would be better to send XML format such as 
<float>-1.2345</float> so that the vagaries of stuffing 
machine-dependent representations of floats into machine-dependent 
representations of integers can be completely avoided, and other formats 
(like imaginary numbers and expressions) could be included as well.
That would require a complete rewrite of the OSC standard though....


Frank Barknecht wrote:
> Hallo,
> Martin Peach hat gesagt: // Martin Peach wrote:
>>Notice that this fix was for the problem with negative ints.
>>The floats would be repaired like this:
>>around line 750:
>>  case f: {
>>    int i = ntohl(*((int *)p));
>>  case f: {
>>    int i = (signed)ntohl(*((int *)p));
>>Now negative ints and floats seem to work, for me at least...
> Floats seemed to work okay already, I thought. Didn't they? 
> I've put your first patch into the CVS now. 
> ciao

More information about the Pd-list mailing list