Open Sound Control (or OSC to its friends) is a popular network protocol used to send information between applications. Often seen as the “spiritual successor” to MIDI, it’s a very simple protocol that’s been adopted as a simple, useful glue. A wide variety of products, programming environments and languages, apps and bits of hardware can send and/or receive OSC messages of various kinds. Just this year, I’ve used it to send the head position and orientaiton of a VR headset to sound spatialization code (running in Max), control playback and scrubbing of a soundtrack in Ableton, and to control graphics from Field from an ipad.
For example — want to push buttons on a cell phone (or get gyroscope information off of one)? There’s an app that sends OSC. Want to send ‘notes’ and control information to Ableton Live, Max 8 or VCV Rack?, Send OSC from automation tracks in Logic Pro? TouchDesigner even Unity?
Field is no exception. Let’s send a number from Field over OSC to something. Three lines:
That’s it! Three benefits of OSC over other protocols. One, it’s ‘stateless’, which is just a fancy way of saying that the two parties to this communication don’t have to speak to each other first before the communication channel is ready for use — Field sends out
/data/ch/1 = 42.3 to anybody (or nobody) listening on port 7001 on the same computer. Secondly, it makes no description of what the data means — it’s up to the code listening to interpret both the 42.3 and the
/data/ch/1. As long as the ‘address’ is separated by (and starts with) ‘/’s its a valid thing to set. Finally, it works over ethernet both local to a machine and between computers in the same way. This alows you to hack on a laptop and then, when you are ready for a performance, separate out the processing across multiple computers — graphics on one machine, sound on another, for example.
This means that code like this: