ScampUtils:
Filter:
ScampUtils (extension) | External Control

ScampUtils
ExtensionExtension

Utilities for interacting with SCAMP

Description

Class containing utilities for interacting with SCAMP (Suite for Computer-Assisted Music in Python)

Class Methods

.instrumentFromSynthDef

Takes a SynthDef, adds it to the server, and sets up all of the relevant OSC listeners to receive messages from SCAMP. After passing a SynthDef to this method, play_note calls from SCAMP will result in the creation of new Synths in the server.

Arguments:

synthDef

A SynthDef with at least a "freq" or "pitch" argument, a "volume" argument, and a "gate" argument. MIDI pitch values will be sent to "pitch", hertz values will be sent to "freq", volume values will be sent to "volume", and start and stop note messages will be translated to the gate argument.

prefix

If Nil, this instrument will list for messages prefixed by the name of the SynthDef. Otherwise, this argument can be used to set a custom message prefix.

initialArgs

A list of arguments, similar to that passed to Synth, specifying the starting values of any arguments other than pitch or volume.

target

Passed along to the target argument of Synth.

addAction

Passed along to the addAction argument of Synth.

.startSynthCompileListener

Listens for OSC messages containing SynthDef code strings, and passes them to instrumentFromSynthDef.

Arguments:

path

The OSC message address pattern at which to listen for SynthDefs

responseAddress

The NetAddr to which a "/done_compiling" message is sent once the SynthDef has been added.

.startRecordingListener

Starts listening for "/recording/start" and "/recording/stop" messages to control the recording of SuperCollider output.

.startQuitListener

Starts listening for "/quit" messages, which will call 0.exit within SuperCollider.

Examples

Starting up a sine wave with vibrato instrument to listen to OSC messages from SCAMP: