scamp_extensions.playback.supercollider.sc_playback_implementation.add_sc_extensions

scamp_extensions.playback.supercollider.sc_playback_implementation.add_sc_extensions()[source]

Adds several new functions to the ScampInstrument class, as well as to the Ensemble (and therefore Session).

New instance methods of ScampInstrument:

add_supercollider_playback(self, synth_def: str): takes a string containing a SuperCollider SynthDef, and adds a SCPlaybackImplementation to this instrument that uses that SynthDef to synthesize sound. (This starts up instances of sclang and scsynth in the background.)

remove_supercollider_playback(self): removes the (most recently added) SCPlaybackImplementation from this instrument’s playback_implementations.

New instance methods of Ensemble / Session:

new_supercollider_part(self, name: str, synth_def: str): Similarly to any of the other “new_part” methods, this adds and returns a newly created ScampInstrument that uses an SCPlaybackImplementation based on the given synth def string.

get_sclang_instance(self): Returns the instance of SCLangInstance that this ensemble is using for supercollider playback (or creates one if none is running).

start_recording_sc_output(self, path, num_channels=2): Tells SuperCollider to start recording the playback to and audio file at the given path, using the specified number of channels.

stop_recording_sc_output(self): Stops recording SuperCollider playback to an audio file.