OSC (Open Sound Control) with Spark Core?

We have been working on porting the CNMAT’s Oscuino library to the Spark Core as well, using suggestions from this thread.

We’ve found out that (as of commit “Enable analogwrite on digital pins” pushed on June 9th), Oscuino code can be kept as is and to get it to work, the only changes we’ve applied were on the Spark’s core-firmware code instead.

As explained by @jfenwick, UDP code for beginPacket(), endPacket() and write() do not work as they are supposed to (and not even [as the documentation says] (http://docs.spark.io/#/firmware/communication-udp))

What we’ve added is a slightly modified UDP class (in application.cpp) overloading the original UDP class. We added buffering for functions beginPacket(), endPacket() and write().

Our code can be browsed in our GitHub repository and we’ve created a thread in the library section.

There you’ll find application.cpp which provides the myUDP class with our modifications and an example application for both reception and emission of OSCMessages and OSCBundles over UDP, as well as associated PD and Max/MSP patches.

Along with it you will get OSCData.h and OSCMessage.h, modified to include the right files for the Spark Core.

Also, this code will only work with the most recent versions of the core-firmware (or the current online compiler of the Spark Cloud, since we use the CFLAGS += -DSPARK recently defined in the Spark’s makefile.

1 Like