[Topic]
OSC

Common Music supports the sending and receiving of OSC messages

[Method]
(send-msg message osc-stream)
Converts a list, message, to osc format and sends out osc-stream.
(send-msg '(1 2 3 4 5.1 "foo" "bar" 'baz) *osc-stream*)
	
[Method]
(send-bundle offset message osc-stream)
Converts a list,message, to osc format and sends out osc-stream with a timestamp of current time plus offset. Message may be a list of lists.
(send-bundle 1.4 '(1 2 3 4 5.1 "foo" "bar" 'baz) *osc-stream*)
(send-bundle .2 '(10 120 10 4.0 .2 'bar) (1 2 3 4 5.1 "foo" "bar" 'baz)) *osc-stream*)
	   

Example

(define *osc-stream* (new osc-stream :remote-host "127.0.0.1" :remote-port 5400))

(open-io *osc-stream*)

(send-msg '("Mr. Watson, come here; I want you.") *osc-stream*)

(define (trigger msg)
  (format t "osc message : ~s ~%timestamep : ~s~%" (first msg) (second msg)))

(set-receiver! #'trigger *osc-stream*)

(remove-receiver! *osc-stream*)

(close-io *osc-stream*)
	 

See also: