jklabs :: EasyOsc

about downloads installation examples protocol extras

EasyOsc is a Java library for doing dead simple Open Sound Control communication. It can be though of as the successor to MaxLink, although it’s a bit of a different beast.

EasyOsc uses two tricks to make things easy: multicast and introspection. Multicast effectively creates a single global channel for all messages, whether they’re running on a single computer or multiple computers on the local network. Introspection means the library can automatically map OSC paths to Java methods. For example, if you have the following Processing code…

EasyOsc osc;

void setup() {
  osc = new EasyOsc(this,"my_sketch")

void message(String text) {
  println("message: " + text);

...then an OSC message /my_sketch/in/message Hello! will cause message: Hello! to be printed in the Processing console. the same thing will work with any String, boolean, char, double, float, int, or arrays of those types. Similarly, the following method

void sendVals(float[] values) {
  osc.send("values", values);

...will send the values array to the OSC address /my_sketch/out/values.

For more details, check out the protocol page.