Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support for more than one parameter #2

Open
hakanai opened this issue Jan 14, 2023 · 0 comments
Open

No support for more than one parameter #2

hakanai opened this issue Jan 14, 2023 · 0 comments

Comments

@hakanai
Copy link

hakanai commented Jan 14, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant