Classes | External Control > OSC

OSCpathResponder : OSCresponder : Object

client side network responder


NOTE: This class is deprecated and will be removed in a future version of SC. Use OSCFunc and OSCdef instead. They are faster, safer, and have more logical argument order than the old responder classes, and they support pattern matching and custom listening ports. Use of the older classes OSCresponder, OSCresponderNode, and OSCpathResponder can be unsafe, since responders in user and class code can override each other unintentionally.

The replacement for path matching is to be found in the template argument of OSCFunc and OSCDef (see example below).

Register a function to be called upon receiving a command with a specific path.

Other applications sending messages to SuperCollider should distinguish between sending messages to the server or the language. Server messages are documented in the Server Command Reference and should be sent to the server's port - s.addr.port - which is 57110 by default. Messages sent to the server will not be processed by any OSCresponder in the language.

Messages from external clients that should be processed by OSCresponders must be sent to the language port, 57120 by default. Use NetAddr.langPort to confirm which port the SuperCollider language is listening on.

See OSC Communication for more details.

Command paths

OSC commands sometimes include additional parameters to specify the right responder.

For example /tr commands, which are generated on the server by the SendTrig Ugen create an OSC packet consisting of: [ /tr, nodeID, triggerID, value]. This array actually specifies the source of value: [ /tr, nodeID, triggerID]. We will refer to that array as a command path.

To create an OSCpathResponder for a specific trigger, the cmdName parameter is simply replaced by the complete command path.

Path defaults

Any element of the command path array can be set to nil to create a responder that will handle multiple command paths.

For example, setting the commandpath: ['/tr', nil, triggerID] makes a responder that responds to /tr messages from any Synth but with a specific triggerID.

Class Methods

OSCpathResponder.new(addr, cmdPath, action)



An instance of NetAddr, usually obtained from your server: server-addr. An address of nil will respond to messages from anywhere.


A command path, such as ['\c_set', bus index].


A Function that will be evaluated when a cmd of that name is received from addr. arguments: time, theResponder, message

NOTE: OSCresponderNode evaluates its function in the system process. In order to access the application process (e.g. for GUI access ) use { ... }.defer; within the action function, e.g., { |time, resp, msg| { gui.value_(msg[3]) }.defer }

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods




.dispatcher = value




.path = value