How to change the default synth in SuperCollider

The default synth sound in SuperCollider is a cheesy old piano sound. If you have ever tried the event pattern examples in the documentation of SuperCollider or been in the process of testing some pattern specifics of your own, you will have heard this extremely unconvincing synthesizer:


().play

A nice alternative: A triangle wave synth with a low pass filter

Imagine a utopian world where the default cheese-piano-synth has been replaced by a nicer, kind of gameboy like synth. Well that world is here and now.

Overwriting the default is actually easy. All you have to do is write a new SynthDef called \default. Evaluate this piece of code:


// A simple triangle wave synth in stereo with panning and a simple low pass filter ( SynthDef.new(\default, { arg dur, attack=0.01, release=1.0, t_gate=1, out, freq=442, cutoff=5500, rq=1, pan=0.0, amp=0.5; var env = EnvGen.kr(Env.perc(attack, release), t_gate, timeScale: dur, doneAction: 2); var sig = DPW3Tri.ar(freq: freq, mul: env); sig = RLPF.ar(sig, cutoff.clip(20.0, 20000.0), rq.clip(0.0,1.0)); sig = Pan2.ar(sig, pan); Out.ar(out, sig * amp); }).add; )

Try this new default synth out by playing the default event again:


().play

Isn’t that much better?

Now, let us try it with patterns:

Pbind(\dur, 0.125, \degree, Pwhite(0,10)).play

Make this the default synth permanently

To make this change permanent we need to edit the startup file for SuperCollider. This is a regular SuperCollider file that is evaluated on startup. It is a good place to keep settings and defaults. Here is how to access it:

  1. Open the SuperCollider IDE

  2. In the top menu, click “File”

  3. In the drop down click “Open startup file”

Now, if we just paste the code from above here, it will still get overwritten by the default synth when booting the server. To get around this, we need to add our synth after the server has booted. We do this by wrapping our SynthDef in a server function called doWhenBooted (s.doWhenBooted{/* paste code here*/}):

// A simple triangle wave synth in stereo with panning and a simple low pass filter
s.doWhenBooted{
SynthDef.new(\default, {
arg dur, attack=0.01, release=1.0,
t_gate=1, out, freq=442, cutoff=5500,
rq=1, pan=0.0, amp=0.5;

var env = EnvGen.kr(Env.perc(attack, release), t_gate, timeScale: dur, doneAction: 2);
var sig = DPW3Tri.ar(freq: freq, mul: env);
sig = RLPF.ar(sig, cutoff.clip(20.0, 20000.0), rq.clip(0.0,1.0));
sig = Pan2.ar(sig, pan);
Out.ar(out, sig * amp);
}).add;
};

Here is what the default synth should now sound like (with a bit of reverb of course)

2 thoughts on “How to change the default synth in SuperCollider

  1. I’d suggest using ServerTree.add { … } instead of doWhenBooted here. doWhenBooted applies only to that specific server. ServerTree (if you don’t specify a server) applies to all of them, including Server objects you haven’t created yet.

Skriv et svar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *

This site uses Akismet to reduce spam. Learn how your comment data is processed.