#use wml::tmpl::main title="osc.el -- Open Sound Control client library for GNU Emacs" PAGE=programming SUBPAGE=osc

<p>
<en><A href="http://www.cnmat.berkeley.edu/OpenSoundControl/">OSC</A> is
protocol for communication among
computers, sound synthesizers, and other multimedia devices that is
optimized for modern networking technology and has been used in many
application areas.</en></p>

<p>
<en><A href="osc.el">osc.el</A> provides a simple library for
communicating with OSC peers via UDP.</en>
<en>Since UDP datagram support was only added to GNU Emacs relatively recently,
you will need Emacs 22 for this Emacs Lisp extension to work.</en>
</p>
<h2><en: How to use OSC from Emacs Lisp?></h2>

<p>
<en>Following is a small example of how to send OSC messages
from Emacs Lisp.</en>
<pre>
(setq my-client (osc-make-client "localhost" 7770))
(osc-send-message my-client "/osc/path" 1.5 1.0 5 "done")
(delete-process my-client)
</pre>
</p>
<p>
<en>To create a server, do something like this</en>:
<pre>
(setq my-server
      (osc-make-server
       "localhost" 7770
       (lambda (path &rest args)
         (message "Unhandled: %s %S" path args))))
(osc-server-set-handler my-server "/a/b/c/d" (lambda (path &rest args) ...))
</pre>

