You must be logged in to post Login

Lost Your Password?

Search Forums:


Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

Sending XML over OSC

No Tags

10:58 am
May 26, 2011



Is sending XML over OSC a good idea? I want to send objects from one application to another. I can serialize the object to XML send it over OSC as a XML string and deserialize it at the receivers end. Or should I use an array with all the property values bundled in one message. Any advice about this.

1:49 pm
May 26, 2011



posts 49

Hello Wouter,

In general, it seems strange that you'd serialize first to XML then to OSC for transmission across the network, only to deserialize at least twice (byte-stream to OSC, OSC to XML) and potentially a third time (XML to application-level object). Why not simply transmit the XML directly?

The idea of OSC is to provide a very lightweight-but-general-purpose protocol for data transmission. XML is general-purpose, but is a much heavier (more overheard) specification than OSC. Not only is the XML format specification heavier, but numeric data, in XML, is represented as strings. In OSC, an integer is only 4-bytes, but a string representation of the same integer could be up to 10 bytes (ASCII encoded). XML is all strings, all the time. 

So my answer is: certainly you can serialize XML as a string object in an OSC message, but I see little reason to do so. Instead, serialize the actual values stored within the XML, using their native types, through OSC. Or transmit the XML directly.


4:52 am
May 27, 2011



You convinced me to ditch the XML idea and put the actual values in the OSC message.

No Tags

About the Bespoke Software forum

No Comment

Comments are closed.