Discussion:
Problem with understanding the standard
(too old to reply)
Thomas Mayer
2017-03-11 15:05:24 UTC
Permalink
Hello,

I am developing an Android app to send sensor data via OSC. While
testing out sending data from multiple dimensions, either the library
for encoding OSC in Java or the library decoding OSC data in Pd contains
an error. Before I file a bug, I have a question about the format:

If I understand it correctly an OSC message contains an address, a type
tag string and the arguments. These are separated by 1-4 NULL bytes. So
if the tag string is ",fff", then the message should have

, f f f <nul> <nul> <nul> <nul> <float values>

Is my understanding correct?

Thanks,
Thomas
--
"From the perspective of communication analysis, government is not
an instrument of law and order, but of law and disorder." (Gracchus
Gruad in: Robert Shea & Robert A. Wilson, The Golden Apple)
http://www.residuum.org/
nik gaffney
2017-03-11 16:44:35 UTC
Permalink
Post by Thomas Mayer
If I understand it correctly an OSC message contains an address, a type
tag string and the arguments. These are separated by 1-4 NULL bytes. So
if the tag string is ",fff", then the message should have
, f f f <nul> <nul> <nul> <nul> <float values>
Is my understanding correct?
Almost. iirc messages should padded to a 4 byte boundary, so in the
example above the extra <nul> are not required.
--
[ f o a m ] -> http://fo.am
grow your own worlds [借景]
Roger Dannenberg
2017-03-11 17:01:16 UTC
Permalink
The 4 null bytes are correct; you need 1 <nul> to terminate the type
string, and 3 more to pad to a 4-byte boundary. (This is all preceded by
an address string, also padded to a 4-byte boundary.)
Post by nik gaffney
Post by Thomas Mayer
If I understand it correctly an OSC message contains an address, a type
tag string and the arguments. These are separated by 1-4 NULL bytes. So
if the tag string is ",fff", then the message should have
, f f f <nul> <nul> <nul> <nul> <float values>
Is my understanding correct?
Almost. iirc messages should padded to a 4 byte boundary, so in the
example above the extra <nul> are not required.
Camille Troillard
2017-03-11 17:01:25 UTC
Permalink
Hi Thomas,

A type tag string is an OSC string.
An OSC string is a sequence of non-nul characters, followed by one nul character, then padded with 0 to 3 nul characters to the next 32 bits boundary.

Therefore the type tag string ", f f f <nul> <nul> <nul> <nul>" is valid; the 4 nuls are required.


Best,
Cam
Post by Thomas Mayer
Hello,
I am developing an Android app to send sensor data via OSC. While
testing out sending data from multiple dimensions, either the library
for encoding OSC in Java or the library decoding OSC data in Pd contains
If I understand it correctly an OSC message contains an address, a type
tag string and the arguments. These are separated by 1-4 NULL bytes. So
if the tag string is ",fff", then the message should have
, f f f <nul> <nul> <nul> <nul> <float values>
Is my understanding correct?
Thanks,
Thomas
--
"From the perspective of communication analysis, government is not
an instrument of law and order, but of law and disorder." (Gracchus
Gruad in: Robert Shea & Robert A. Wilson, The Golden Apple)
http://www.residuum.org/
_______________________________________________
OSC_dev mailing list
http://lists.create.ucsb.edu/mailman/listinfo/osc_dev
Thomas Mayer
2017-03-11 18:11:19 UTC
Permalink
Hi,
Post by Camille Troillard
Hi Thomas,
A type tag string is an OSC string.
An OSC string is a sequence of non-nul characters, followed by one nul character, then padded with 0 to 3 nul characters to the next 32 bits boundary.
Therefore the type tag string ", f f f <nul> <nul> <nul> <nul>" is valid; the 4 nuls are required.
thanks. Now I know which of the OSC implementations is wrong and I will
file a bug report and possibly a pull request.

Thomas
--
"In an era when everything can be surveiled, all we have left is
politeness."
(Major Napier in: Neal Stephenson: The Diamond Age)
http://www.residuum.org/
Thomas Mayer
2017-03-11 18:21:20 UTC
Permalink
Post by Thomas Mayer
Hi,
Post by Camille Troillard
Hi Thomas,
A type tag string is an OSC string.
An OSC string is a sequence of non-nul characters, followed by one nul character, then padded with 0 to 3 nul characters to the next 32 bits boundary.
Therefore the type tag string ", f f f <nul> <nul> <nul> <nul>" is valid; the 4 nuls are required.
thanks. Now I know which of the OSC implementations is wrong and I will
file a bug report and possibly a pull request.
I have just found out, that the bug has already been fixed:

https://github.com/hoijui/JavaOSC/issues/25

Thanks,
Thomas
--
"Theoretically, [the amount of money in circulation] is watched
carefully by clever, serious economists. In practice, all the world's
money is one big swirling, whirling pool." (Cory Doctorow - For The Win)
http://www.residuum.org/
Loading...