Skip to content
/ osc Public

a common lisp implementation of the Open Sound Control protocol aka OSC

License

Notifications You must be signed in to change notification settings

zzkt/osc

Repository files navigation

Open Sound Control

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

OSC 1.0 and 1.1 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 tagtypedescriptionv1.0v1.1cl-osc
iint3232-bit big-endian two’s complement integerRRYES
ffloat3232-bit big-endian IEEE 754 floating point numberRRYES
sOSC-stringA sequence of non-null ASCII characters followed by a null…R
followed by 0-3 additional null characters. Total bits is a multiple of 32.RNYES
bOSC-blobAn int32 size count, followed by that many 8-bit bytes of arbitrary binary data…R
followed by 0-3 additional zero bytes. Total bits is a multiple of 32.RNYES
TTrueNo bytes are allocated in the argument data.OR
FFalseNo bytes are allocated in the argument data.OR
NNull(aka nil, None, etc). No bytes are allocated in the argument data.OR
IImpulse(aka “bang”), used for event triggers. No bytes are allocated in the argument data.OR
tOSC-timetagan OSC timetag in NTP format, encoded in the data sectionOR
hint6464 bit big-endian two’s complement integerOOYES
dfloat6464 bit (“double”) IEEE 754 floating point numberOOYES
SOSC-stringAlternate type represented as an OSC-string (e.g to differentiate “symbols” from “strings”)OOYES
can ascii character, sent as 32 bitsOO
r32 bit RGBA colorOO
m4 byte MIDI message. Bytes from MSB to LSB are: port id, status byte, data1, data2OO
[Indicates the beginning of an array. The tags following are for data in the Array.OOYES?
]Indicates the end of an array.OOYES?
  • Required, Optional and Not supported (or Not required).
  • 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-latestubuntu-latestwindows-latest
sbcl🟢🟢🟢
ccl-bin🟡 (x86_64 only)🟢🟢
ecl🟢🟢?
allegro?🟡?
other????

About

a common lisp implementation of the Open Sound Control protocol aka OSC

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published