Saturday, May 9, 2009

Guitar effects

I've concentrated mostly on synthesis so far with my SuperCollider experiments, but today for a change I've been trying out some audio prosessing with a live input, my guitar.

To get a Mic or line input in SC you have several options, but using a SoundIn Ugen seems to be the easiest. SoundIn is a wrapper for the standard In Ugen, but it makes thigs easier by offsetting the bus index so that the first audio input is always 0. Setting up audio in in SuperCollider can be a bit of a chore, so check the help file if you can't fathom how input works.

Let's start with distortion, there's loads of ways of doing this,


using fold2 works well, as does clip


and there's also the obviously titled distort


The effect of this sems to be fairly subtle though. Making better use of it is this SynthDef, which comes from the Pfx help file, last used with my drum machine.

SynthDef(\distort, { arg out=0, pregain=40, amp=0.2, gate=1;

var env;

env =, 0.05, 1, 0.1, 2);, env, (, 2) * pregain).distort * amp);

}, [\ir, 0.1, 0.1, 0]).store;

You'll need to use a line like this to set the synth up.

a = Synth(\distort, addAction:\addToTail)

and if you're feeling like Alec Empire you can't beat a bit of bitcrushing for uttlerly insane fuzz.

{, 10000, 1)}.play

FreeVerb is an excellent choice for reverb,


but something like flange is more difficult. This example is taken from the ixi-audio tutorial from, very slightly adapted to fit my audio input busses.

A flange effect adds a continually varying delayed signal to the original creating a phasing effect. The AllpassL in this case is the delay, with the LFpar UGen controlling the delay time, which is then mixed with the original input.


SynthDef(\flanger, { arg out=0, in=0, delay=0.1, depth=0.08, rate=0.06, fdbk=0.0, decay=0.0;

var input, maxdelay, maxrate, dsig, mixed, local;
maxdelay = 0.013;
maxrate = 10.0;
input =, 1);
local =;
dsig = // the delay (you could use AllpassC (put 0 in decay))
input + (local * fdbk),
maxdelay * 2, // very similar to SinOsc (try to replace it) - Even use LFTri
rate * maxrate,
depth * maxdelay,
delay * maxdelay),
mixed = input + dsig;;[out, out+1], mixed);

After evaluating that SynthDef you'll need to set up an instance of the synth and set the audio in like this,

a = Synth(\flanger, [\in, 0], addAction:\addToTail)

you can then set the various parameters of the effect like this.

a.set(\delay, 0.04)
a.set(\depth, 0.04)
a.set(\rate, 0.01)
a.set(\fdbk, 0.08)
a.set(\decay, 0.01)



  1. those are some cool effects. thanks for posting them. do you know of any other cool ones?

  2. I guess this info is totally unique.