Skip to main content

Easily control SuperCollider sound server from python

Project description

SC allows to easily control Supercollider
(http://en.wikipedia.org/wiki/SuperCollider) sound server (scsynth) from Python.

It wraps scsynth / scosc libraries by Patrick Stinson
(http://trac2.assembla.com/pkaudio).They allow Python to talk to scsynth via
OpenSoundControl (http://en.wikipedia.org/wiki/Open_Sound_Control). SC
provides with a simpler API to use those libraries. However advance users might
want to bypass SC and use those libraries directly.

Using SC, Supercollider Synthdefs can be loaded into the scsynth server
therefore can be totally controlled from python.

New synthdefs can be instantiated in real time new conections can be
created and modified. SC can also be used from interactive Python to do live coding
(http://en.wikipedia.org/wiki/Live_coding).

For example a simple synthdef that sends a sine wave to the sound card would
look like this in Supercollider's sclang :

(
SynthDef(\sine, { |amp = 0.5, freq = 440|
var data = SinOsc.ar(freq, 0, amp);
Out.ar(0, data ! 2);
}).store;
)

Compiling this produces a file called sine.scsyndef that can be later loaded
and controlled from Python using the SC module as easy as this:

sine = sc.Synth( "sine" )
sine.freq = 444
sine.amp = 0.9
... and so on ...

Project details


Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page