xemantic/xemantic-osc

No support for more than one parameter

hakanai opened this issue · 0 comments

After reading the code, I realised the code was writing the type specifiers the values in the wrong order, such that it would not be possible to support multiple values without a significant rewrite of the code.

For example, the convertor for float writes the type specifier and then immediately writes the value:
https://github.com/xemantic/xemantic-osc/blob/main/src/commonMain/kotlin/OscApi.kt#L72

But the correct thing to do is to write all the type specifiers first, then write all the values.

One of the messages in the official examples demonstrates this:

  2f 66 6f 6f 00 00 00 00  = "/foo"
  2c 69 69 73 66 66 00 00  = ",iisff"
  00 00 03 e8              = 1000
  ff ff ff ff              = -1
  68 65 6c 6c 6f 00 00 00  = "hello"
  3f 9d f3 b6              ≅ 1.234
  40 b5 b2 2d              ≅ 5.678

Examples are publicly documented along with the spec.
https://opensoundcontrol.stanford.edu/spec-1_0-examples.html#osc-message-examples