On Thu, 16 Mar 2006, Martin Peach wrote:
But encoding and decoding it is pretty complicated.
Complicated compared to what?
I meant in general, but one could compare it to MIDI, for example, which is a lot easier to parse as the data types and the data come bundled, whereas with OSC you have them separated, which makes parsing harder because you have to maintain a pointer to the data and the types. Also if you start to think about timetagged, recursive bundles of messages and the way you would deliver them correctly it gets pretty hairy.
Writing a correct OSC parser is not trivial.
Guenter
It could be made simpler for low-speed serial systems such as MIDI and RS232 by simply sending the whole thing as ASCII text instead of 4-byte padded binary. Bit 7 (the MSB) can then be used to delimit packets. In MIDI it could be sent as a sysex message without having to pack and unpack 8 bits to 7 bits. It would also be human-readable for debugging. As far as PD goes, it would be nice to have the OSC objects use the same code as netsend and netreceive, that way TCP could be used as well as UDP, and all the networking would use the same code, i.e. the code in x_net.c. At the moment the PD OSC objects use Adrian Freed's htmsocket.c which handles its own (UDP or UNIX) sockets.
Martin