Music Technology

SuperCollider: Getting Started

Boot a server, make a sine wave, then find out why the language and the synthesis engine being two separate programs is the whole point.

SuperCollider has a reputation for being hard. It isn’t, exactly — it’s that the first thing you have to understand is structural rather than musical, and most tutorials make a sound before explaining it.

1. Install it

Download from supercollider.github.io — macOS, Windows and Linux builds, currently 3.14.x. Install and open the SuperCollider IDE, which is what you get by default.

You’ll see three panes: a code editor, a post window (where the program talks back), and a help browser. The help browser is not optional reading. SuperCollider’s documentation is built in and genuinely excellent, and the shortcut to open the help for whatever your cursor is on — Cmd/Ctrl + D — is the single most useful key combination in the program.

2. The thing to understand first

SuperCollider is two programs.

  • sclang — the language. An object-oriented interpreter where you write code. This is what your editor is talking to.
  • scsynth — the server. A real-time audio synthesis engine. It makes all the sound. It knows nothing about the language.

They communicate over OSC (Open Sound Control), a network protocol. They are separate processes, and they can be on separate machines.

This is why SuperCollider feels different from a DAW or from Max. You are not manipulating audio directly. You are sending messages to an audio engine, and your code is the thing composing those messages. Once that lands, most of the confusing parts stop being confusing: why you have to boot the server, why code can keep running after a sound starts, why a crashed language doesn’t necessarily stop the audio.

Boot the server before anything else: Server.default.boot; — or Cmd/Ctrl + B. Watch the post window for the “server ready” line.

3. Your first sound

Type this, put the cursor on the line, and press Cmd/Ctrl + Enter to evaluate:

{ SinOsc.ar(440, 0, 0.2) }.play;

A 440 Hz sine at amplitude 0.2.

Cmd/Ctrl + Period stops all sound. Learn this before you learn anything else. You will need it in about thirty seconds.

Reading the line: SinOsc is a UGen (unit generator), the building block of all synthesis here. .ar means audio rate — compute a value every sample. Its sibling .kr is control rate, computed far less often, for things like envelopes and LFOs where sample accuracy is wasted effort. Arguments are frequency, phase, and multiplier.

Wrapping something in { } makes it a Function; calling .play on it compiles it into a synth on the server and starts it.

Now modulate it:

{ SinOsc.ar(SinOsc.kr(0.5).range(300, 600), 0, 0.2) }.play;

A slow sine at control rate, scaled to 300–600 Hz, driving the frequency of an audio-rate sine. UGens plug into each other’s arguments. That’s the whole composition model.

4. Stereo, and a very common surprise

{ SinOsc.ar([440, 443], 0, 0.2) }.play;

Give a UGen an array where it expects a number and SuperCollider builds one copy per element — multichannel expansion. Two sines, three hertz apart, one per speaker. Slow beating, wide stereo, no extra code.

This is enormously powerful and it is also where beginners accidentally spawn 64 oscillators. If your CPU suddenly spikes, count your arrays.

5. SynthDefs: making it reusable

{ }.play is for sketching. For anything you want to trigger repeatedly, define a SynthDef:

(
SynthDef(\ping, { |freq = 440, amp = 0.2, pan = 0|
    var env, sig;
    env = EnvGen.kr(Env.perc(0.01, 0.4), doneAction: 2);
    sig = SinOsc.ar(freq) * env * amp;
    Out.ar(0, Pan2.ar(sig, pan));
}).add;
)

Synth(\ping, [\freq, 660]);

Wrapping a block in ( ) and evaluating anywhere inside it runs the whole block — that’s how you evaluate multi-line code.

Two details that matter:

  • doneAction: 2 frees the synth when the envelope finishes. Leave it out and every note you play stays alive forever, silently, until the server runs out of nodes. This is the classic SuperCollider memory leak.
  • Out.ar(0, ...) writes to bus 0, the left output. Pan2 turns a mono signal into a stereo pair, so this covers both channels.

6. Patterns: the reason people stay

You could sequence with clocks and loops. Almost nobody does, because SuperCollider has Patterns — a declarative sequencing system that is the best part of the whole environment.

(
Pbind(
    \instrument, \ping,
    \degree, Pseq([0, 2, 4, 7, 4, 2], inf),
    \dur, 0.25,
    \amp, Pwhite(0.1, 0.3)
).play;
)

Pbind binds keys to value streams. Pseq walks a list, inf times. Pwhite gives uniform random values in a range. \degree is scale degree — SuperCollider converts it to frequency for you, so you’re writing in a scale rather than in hertz.

Swap Pseq for Prand and it’s random order. Nest patterns inside patterns and you get structure. This is where livecoding SuperCollider actually happens: you re-evaluate a Pbind and the change takes effect at the next beat.

Stop a single pattern by assigning it — p = Pbind(...).play; then p.stop; — rather than hitting Cmd+Period, which kills everything.

7. The shortcuts you’ll actually use

ActionKey
Evaluate line or blockCmd/Ctrl + Enter
Stop all soundCmd/Ctrl + Period
Boot serverCmd/Ctrl + B
Open help for symbol under cursorCmd/Ctrl + D
Show server metersCmd/Ctrl + M
Clear post windowCmd/Ctrl + Shift + P

8. Where to go after this

Work through “Getting Started With SC” in the built-in help — it’s by Scott Wilson and James Harkins and it’s the canonical path. Eli Fieldsteel’s YouTube series is the best video treatment of the language and goes far deeper than an introduction. Bruno Ruviaro’s “A Gentle Introduction to SuperCollider” is a free PDF and the friendliest text.

Then the choice of direction: Patterns if you want to compose, SynthDefs and UGen graphs if you want to build instruments, sc3-plugins if you want the extended UGen set, or TidalCycles/FoxDot, which use scsynth as their engine and hand you a different language on top of it.