Sending OSC from SuperCollider

For sending OSC from SuperCollider, a NetAddr object needs to be generated. It needs an IP address and a port:

~out_address  = NetAddr("", 6666);

Sending Values Once

This first example sends an OSC message once when the following line is evaluated. The previously created NetAddr object can be used to send OSC messages with its sendMsg method:

~out_address.sendMsg('/test/message', 1);

Sending Values Continuously

Based on the previous example, a routine can be created which continuously reads values from control rate buses to send their instantaneous value via OSC. The osc_routine runs an infinite loop with a short wait interval to limit the send rate and the CPU load:

  ~cBus = Bus.control(s,1);

  ~osc_routine = Routine({{

      // read value from bus
                  var value      = ~cBus.getSynchronous(~nVbap);

      // send value
                  ~out_address.sendMsg('/oscillator/frequency', value);

                  // wait


Once created, the routine can be started and stopped with the methods play() and stop(). While running, bus values can be changed to test the functionality:;






Run the PD patch osc-receive.pd to receive values from SuperCollider via OSC and control the pitch.

Contents © Henrik von Coler 2021 - Contact