scamp_extensions.playback.supercollider.sc_lang.SCLangInstance

class scamp_extensions.playback.supercollider.sc_lang.SCLangInstance[source]

Bases: object

Object that starts up an instance of sclang as a subprocess, and facilitates communication with that subprocess via OSC. The SCAMP supercollider extensions will be loaded into the sclang library path.

Methods

new_synth_def(synth_def_code)

Sends the given SynthDef to SuperCollider to compile and add to the server.

send_message(address, value)

Sends an OSC message to the running instance of sclang.

wait_for_response(address)

Waits for a response from sclang to be sent to the given address, confirming that we are on the same page and telling us what address to send messages to.

send_message(address, value) None[source]

Sends an OSC message to the running instance of sclang.

Parameters:
  • address – the osc address string

  • value – the message value

wait_for_response(address) str[source]

Waits for a response from sclang to be sent to the given address, confirming that we are on the same page and telling us what address to send messages to.

Parameters:

address – the OSC message address at which to expect the response.

new_synth_def(synth_def_code: str) None[source]

Sends the given SynthDef to SuperCollider to compile and add to the server.

Parameters:

synth_def_code – the sclang code for the SynthDef (i.e. “SynthDef(nameOFSynth, {[ugen graph function]}”).