a common lisp implementation of the Open Sound Control protocol aka OSC
  • Common Lisp 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
nik gaffney 320a554529
Some checks failed
CI / ccl-bin on ubuntu-latest (push) Has been cancelled
CI / ccl-bin on windows-latest (push) Has been cancelled
CI / ecl on macos-latest (push) Has been cancelled
CI / ecl on ubuntu-latest (push) Has been cancelled
CI / sbcl-bin on macos-latest (push) Has been cancelled
CI / sbcl-bin on ubuntu-latest (push) Has been cancelled
CI / sbcl-bin on windows-latest (push) Has been cancelled
hyposcleral
* README updates
2026-08-16 14:24:19 +02:00
.github/workflows Update ci.yaml 2024-06-05 10:56:24 +02:00
AUTHORS LLGPL → GPLv3 #12 2023-12-28 19:29:47 +01:00
LICENSE LLGPL → GPLv3 #12 2023-12-28 19:29:47 +01:00
osc-dispatch.lisp toscanite 2006-04-05 18:33:33 +08:00
osc-examples.lisp remind user of the docs of ip addr syntax 2017-12-01 09:47:42 -08:00
osc-tests.lisp osculated 2026-08-16 13:20:34 +02:00
osc.asd synchroscope (part 2) 2023-12-31 17:33:12 +01:00
osc.lisp osculated 2026-08-16 13:20:34 +02:00
README.org hyposcleral 2026-08-16 14:24:19 +02:00

This is a lisp implementation of the Open Sound Control protocol (or more accurately “data transport specification” or “encoding”). The code should be close to ANSI standard common lisp and provides self contained code for encoding and decoding of OSC data, messages, and bundles. Since OSC describes a transport independent encoding (and does not specify a transport layer) messages can be send using TCP, UDP or other network protocols (e.g. RFC 2549). It seems UDP is more common amongst programmes that communicate using OSC and. the osc-examples.lisp file contains a few simple examples of how to send and receive OSC via UDP. The examples are reasonably compatible with the packets send from/to max-msp, pd, supercollider and liblo. more details about OSC can be found at https://OpenSoundControl.org

The current version of this code is available from github

git clone https://github.com/zzkt/osc

or via quicklisp.. .

(ql:quickload "osc")

or guix

guix install cl-osc

Testing

The file osc-test.lisp contains a test suite which should cover as much as possible of the OSC protocol. Tests can be run from the REPL via ASDF or command line.

(asdf:test-system "osc")

or from a shell…

sbcl --non-interactive --eval '(asdf:test-system "osc")'

or, load the tests directly and run synchroscope (which contains all sub-tests)

(ql:quickload "osc/tests")
(fiveam:run! 'osc/tests::synchroscope)

OSC v1.0 and v1.1 protocol support

This implementation supports the OpenSoundControl Specification 1.0 and the required typetags listed in the OpenSoundControl Specification 1.1 (as described in an NIME 2009 paper). Some optional types are supported.

Type tag type description v1.0 v1.1 cl-osc
i int32 32-bit big-endian twos complement integer R R Y
f float32 32-bit big-endian IEEE 754 floating point number R R Y
s OSC-string A sequence of non-null ASCII characters followed by a null… R Y
followed by 0-3 additional null characters. Total bits is a multiple of 32. R N Y
b OSC-blob An int32 size count, followed by that many 8-bit bytes of arbitrary binary data… R Y
followed by 0-3 additional zero bytes. Total bits is a multiple of 32. R N Y
T True No bytes are allocated in the argument data. O R Y
F False No bytes are allocated in the argument data. O R Y
N Null (aka nil, None, etc). No bytes are allocated in the argument data. O R Y
I Impulse (aka “bang”), used for event triggers. No bytes are allocated in the argument data. O R Y
t OSC-timetag an OSC timetag in NTP format, encoded in the data section O R Y
h int64 64 bit big-endian twos complement integer O O Y
d float64 64 bit (“double”) IEEE 754 floating point number O O Y
S OSC-string Alternate type represented as an OSC-string (e.g to differentiate “symbols” from “strings”) O O Y
c an ascii character, sent as 32 bits O O Y
r 32 bit RGBA color O O Y
m 4 byte MIDI message. Bytes from MSB to LSB are: port id, status byte, data1, data2 O O Y
[ Indicates the beginning of an array. The tags following are for data in the Array. O O ?
] Indicates the end of an array. O O ?
  • Required, Optional and Not supported (or Not required)
  • type S is encoded as a UTF-8 string by cl-osc
  • data is encoded as (vector (unsigned 8)) by cl-osc

Platform support

currently supported and/or tested OS and CL platforms (platform names from github CI & roswell)

macos-latest ubuntu-latest windows-latest
sbcl 🟢 🟢 🟢
ccl-bin 🟡 (x8664 only) 🟢 🟢
ecl 🟢 🟢 ?
allegro ? 🟡 ?
other? ? ? ?