What is OSC?

Theatre Technology

OSC is one of the greatest protocols for getting signals around your creative project! OSC stands for Open Sound Control, which is an open standard that defines how creative applications can communicate with one another.

What is OSC?


Today I am going to teach you what OSC is, how it works, and why you should use it in your next interactive project. And be sure to stick around to the end of the video to see some of the useful libraries I use to implement OSC in various pieces of software. 

First and foremost OSC is an acronym for Open Sound Control. It is a content format that was developed at the University of Berkley. If you are from the world of programming it is a format similar to either JSON or XML. Its original purpose was to share performance data, which includes things like note sequences, gestures, and many other parameters between musical instruments. That’s where the word sound comes from in Open Sound Control. Today however OSC has expanded way beyond just sound applications. 

p2p

OSC at its most basic is a peer-to-peer messaging protocol. One thing that sets it apart from others is that it is open ended and dynamic. If you are from the world of live theatre or music you have probably come across DMX and MIDI. These are great at what they are meant to do, however, we could not send both number values and strings at the same time since those protocols have a fixed data size. This is why having an open ended messaging protocol is so important.

The OSC Address


OSC Address

Let's take a look at how we would use OSC. The OSC message is made up of two main components. The address and the data itself. The address is very similar to a url you would use to navigate to a webpage on the internet. I think it is easier to explain by using an example. Say we want to play a cue inside QLab, which is a software for sound and projection. We would start with a slash, then would type workspace then slash followed by the workspace id one more slash and then go. When we send this to QLab it will play the selected cue. All applications that respond to OSC commands will have their own address structure and will provide documentation that outlines what the address should be for each respective action. 

The OSC Payload



OSC Payload


OCS also has the ability to send a data payload. Sticking with our QLab example from before, what if we wanted to play a certain cue number? We would keep the address the same, however, we can add a space then type what cue number we want to play. We are also able to keep adding as many pieces of data as we want. For example, in QLab if we wanted to control the live average level for a cue we could provide both the low value and the high value.


Now that we have an idea of what we need to send let's look at how we are going to send it. OSC is what is known as a transport-independent protocol. This means that it does not actually matter how the message gets from point A to point B, as long as it does get there. Heck, you could technically send it over telegraph and not violate the OSC specification. However, whenever we use OSC these days we 99% of the time are going to use an IP network. An IP network is what you have in your home either wifi or plugging into an ethernet port.

TCP vs UDP

Network


Within IP networking there are two main protocols that we use. TCP, which stands for Transmission Control Protocol and UDP which stands for User Datagram Protocol. The main difference between the two are TCP guarantees that your message will arrive intact, and UDP does not guarantee that it will even arrive. Most of the time OSC is done over UDP on a local network, which is just fine. However, if you ever need to send OSC long distances or on a congested network use TCP. Sometimes the application you are using for OSC will only support one or the other, so make sure to check the documentation first.


Regardless of which protocol you use, we will need to send our message to the correct place. Each device on a network has an IP address. We will need to find the IP address of the target device that we are wanting to send an OSC message to. The last piece of information we need is the port number. In computer networking ports are like little doors that we can open to let our messages pass through. The device receiving OSC messages will either provide you a default port number or have you choose one manually. Generally you can use any number you like, however, be sure to not use one of the few numbers that are designated for other common services.


This brings us to why you should use it for your next project. Since OSC is such a widely used protocol and is supported by many applications it allows us to easily make a wide range of software tools talk to one another to create awesome projects.