osc/msg
msg-new
(msg-new [path :cstr] :int)
create a new OSC message for the given address path.
| path | OSC address path string (e.g. "/synth/freq") |
Wrapper :int handle; pass to msg-add-*, msg-free, and client-send.
(let [m (msg-new "/synth/freq")]
(msg-add-float m 440.0)
...)
Since: OSC0
msg-add-float
(msg-add-float [m :int f :float] :void)
append a float argument to a message.
| m | wrapper :int (return value of msg-new) | |
| f | float value to append |
void
(msg-add-float m 440.0)
Since: OSC0
msg-add-int
(msg-add-int [m :int i :int] :void)
append a 32-bit integer argument to a message.
| m | wrapper :int (return value of msg-new) | |
| i | integer value to append |
void
(msg-add-int m 1)
Since: OSC0
msg-add-string
(msg-add-string [m :int s :cstr] :void)
append a string argument to a message.
| m | wrapper :int (return value of msg-new) | |
| s | string value to append |
void
(msg-add-string m "hello")
Since: OSC0
msg-free
(msg-free [m :int] :void)
free a message wrapper and the underlying lo_message.
| m | wrapper :int (return value of msg-new) |
void
(msg-free m)
Since: OSC0
msg-path
(msg-path [m :int] :cstr)
return the OSC address path of a message.
| m | wrapper :int (return value of msg-new) |
Path string as :cstr; valid until msg-free is called.
(msg-path m) ; => "/synth/freq"
Since: OSC0
msg-arg-count
(msg-arg-count [m :int] :int)
return the number of arguments in a message.
| m | wrapper :int (return value of msg-new) |
Argument count as :int.
(msg-arg-count m) ; => 2
Since: OSC0
msg-arg-type
(msg-arg-type [m :int i :int] :cstr)
return the OSC type tag character for argument i.
| m | wrapper :int (return value of msg-new) | |
| i | 0-based argument index |
Single-character type tag as :cstr (e.g. "f", "i", "s").
(msg-arg-type m 0) ; => "f"
Since: OSC0
msg-arg-float
(msg-arg-float [m :int i :int] :float)
return argument i of a message as a float.
| m | wrapper :int (return value of msg-new) | |
| i | 0-based argument index |
Argument value as :float.
(msg-arg-float m 0) ; => 440.0
Since: OSC0
msg-arg-int
(msg-arg-int [m :int i :int] :int)
return argument i of a message as an integer.
| m | wrapper :int (return value of msg-new) | |
| i | 0-based argument index |
Argument value as :int.
(msg-arg-int m 0) ; => 1
Since: OSC0
msg-arg-string
(msg-arg-string [m :int i :int] :cstr)
return argument i of a message as a string.
| m | wrapper :int (return value of msg-new) | |
| i | 0-based argument index |
Argument value as :cstr; valid for the lifetime of the lo_message.
(msg-arg-string m 0) ; => "hello"
Since: OSC0