OSCdef triggers a function on incoming OSC and can be re-evaluated live to remap external data to sound
Open Sound Control is a common language that lets programs communicate across a network, carrying typed data to an address and port. In SuperCollider, OSCdef triggers a particular function when an OSC message is received; the message arrives as an array with the address at index 0 and parameters after it, so the handler can pull values and route them to synthesis parameters. What makes this powerful for live coding is that the OSCdef can be changed and re-evaluated on the fly, changing data mappings — the performer rewrites how incoming sensor, phone, or program data drives sound during the set, and it integrates with ProxySpace so the mapped values steer running proxies.
Examples
OSCdef(‘sensor’, {|msg| ~cutoff = msg[1]}, ‘/sensor/value’); re-evaluate mid-set to remap the same stream to a different parameter.
Assessment
Trace the path of a value from a hardware sensor to a SuperCollider synthesis parameter via OSC, and explain why re-evaluating an OSCdef during performance is musically useful.