Project: SuperCollider client for Processing

A Processing library to interface with the SuperCollider synthesis engine.


Download (zip, 88KB)

This library provides a simple approach to interfacing with the powerful SuperCollider sound synthesis engine. It provides objects to encapsulate common functions such as creating and manipulating Synth, Buffer and Bus objects.

Formerly known as p5_sc, now renamed for the release of Processing 2.0.

Example works

Installation

The latest code can be found at github, with a snapshot available here.

Now open a new sketch, and the Import Library menu should include an entry for 'supercollider'. To get started, run the sample code below, or browse the class documentation.

Helper functions

A series of helper functions are also available which provide frequently used client-side operations (mapping between parameters, clipping values, MIDI/frequency conversion, non-uniform random number generation).

Usage (SuperCollider)

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

Usage (Processing)

import supercollider.*;
import oscP5.*;
import netP5.*;

Synth synth;

void setup ()
{
    size(800, 200);

    // uses default sc server at 127.0.0.1:57110    
    // does NOT create synth!
    synth = new Synth("sine");
    
    // set initial arguments
    synth.set("amp", 0.5);
    synth.set("freq", 80);
    
    // create synth
    synth.create();
}

void draw ()
{
    background(0);
    stroke(255);
    line(mouseX, 0, mouseX, height);
}

void mouseMoved ()
{
    synth.set("freq", 40 + (mouseX * 3)); 
}

void exit ()
{
    synth.free();
    super.exit();
}

Changes