Open Sound Control
Open Sound Control (OSC)[1] is a content format developed at CNMAT by Adrian Freed and Matt Wright. It was originally intended for sharing music performance data between electronic musical instruments, computers, and other multimedia devices. OSC messages are commonly transported within home and studio computer networks, but can also be transmitted across the internet. OSC gives musicians and developers more flexibility in the kinds of data they can send over the wire, enabling new applications that can communicate with each other at a high level.
Zeal has created an in-depth explanation and tutorial video on OSC, explaining the what and the why, as well as how it can be used to have Max/MSP and Processing communicate.
The great advantage of OSC is that while there is a per-message schema, there is no overall fixed schema to define or restrict the set of possible messages, as is the case with legacy protocols (e.g. MIDI, DMX). A second advantage is that older protocols can be straightforwardly translated to and from OSC. Finally, OSC messages are self-descriptive: just by looking at the text of a message, you can tell what it is for, unlike with any of its predecessors. So, for example where a note-on MIDI message is an arcane cryptic series of numbers: 1001 0011–0100 0101–0100 1111[2], an analogous OSC message would be: /Synth/MIDI/Channel_1/Note_On, tt: “ii”, 69, 79.
To describe OSC i paraphrase its creators[3]: the basic unit of OSC is a message, consisting of an Address Pattern (AP), a Type Tag String (TTS), an optional time tag, and arguments. The AP is a string specifying the entity or entities within the OSC server to which the message is directed, a hierarchical name space, reminiscent of a file-system path, or a URL. The TTS is a compact string representation of the argument types. The core types supported are:
- Integer numbers (tt: ‘i’)
- Floating point numbers (tt: ‘f’)
- Strings of text (tt: ‘s’)
TWO also supports the following Type Tags, although these are less frequently used, and not always supported by OSC-capable programs.
- Boolean type (tt: ‘T’: true, ‘F’: false)
- Arbitrary sized binary data ‘blob’ (e.g. audio data, or a video frame) (tt: ‘b’)
- Null, meaning there are no values (tt: ’N’).
- Impulse/Bang/Infinitum (tt ‘I’): A trigger message, which only conveys that something needs to happen, but with no additional parameters, just like with bang in Max/MSP / Pure Data (as OSC has been revised the message name has changed, but the functionality is the same).
- Time Tag (tt ‘t’): a time-tag, mostly used by receivers to reduce time jitter in the interpretation of messages.
Finally the arguments are the data contained in the message. So in the message /voices/3/freq, ‘f’ 261.62558, the AP is followed by the TTS and finally the corresponding argument. All points of control of an OSC server are organized into a tree-structured hierarchy called the server’s namespace (the aforementioned description). An OSC AP is the full path from the root of the address space tree to a particular node. In the above example the AP points to a node named “freq” that is a child of a node named “3”, itself a child of a node named “voices”. The full set of possible combinations of APs and TTSs that an OSC server responds to, we here refer to as that server’s namespace. And, by OSC server, we refer to any device or program that can respond to and/or transmit OSC messages, be it a synthesizer, TWO, a keyboard controller, a wireless sensor, etc.
OSC provides for several advantages compared to the previous de facto standards of their respective fields, MIDI, DMX, etc. Using OSC, interoperability between an arbitrary number of disparate sources and destinations is straightforward. No longer are digital musical instruments forced to adhere to the strained façade that they can behave as keyboard instruments, as was the case with MIDI, when in fact they are nothing of the sort (see for example drum, wind and guitar controllers).
[1] Parts of this section have been adapted from the Wikipedia article on Open Sound Control: http://en.wikipedia.org/wiki/Open_Sound_Control
[2] http://www.tonalsoft.com/pub/pitch-bend/pitch.2005-08-31.17-00.aspx
[3] M. Wright, A. Freed, and A. Momeni, “OpenSound Control: state of the art 2003,” in Proceedings of the 2003 conference on New interfaces for musical expression, 2003, pp. 153–160.
The OSC Ecosystem
Following is a representative sample of OSC capable hardware and software, to give an overview of what there already is out there.
Music and Audio Software
VST plugins for sending/receiving OSC
Show Control / Media servers
OSC re-routing
Multimedia software for VJing, Installations
iPad / Tablet apps
OSC Sequencer software
OSC-capable Hardware
Creative Coding Environments
Good Libraries Implemented for Virtually all Important Programming Languages
C++ / C; C#; Objective C; Java; Python; Erlang; …and many more