Introduction
In March of 1996, James McCartney announced to the comp.music.research mailing list the release of his new real-time synthesis language. Originally a Max/MSP object known as Pyrite, SuperCollider was now available as a standalone program. SuperCollider was inspired by older programs such as the MUSIC-N family and Csound, but designed to be easier to use and optimized for real-time processing.
In the late 90's, SuperCollider gained popularity in the academic computer music research community. Two major versions later, SuperCollider 3 — a major architectural rewrite that separated the programming language from the audio server — was released as free software under the GNU General Public License.
Why SuperCollider?
Flexibility. SuperCollider is lower level than most modern audio synthesis environments, only a few steps away from writing raw DSP code. Like most "deep modular" programs, it gives you a tremendous spectrum of options for designing sound.
Interface. Graphical patching environments, either software or hardware, have been the dominant approach to modular audio synthesis throughout history. While visual programming is powerful, many find it frustrating when scaling up to large patches with hundreds of nodes. Code seems like a strange interface for sound synthesis, but you might find it surprisingly ergonomic once you spend some time with it! SC is also hugely popular within the live coding community, and there are many artists who perform by writing and running SC code live.
Education. SuperCollider is a great environment for understanding the fundamentals of sound synthesis, and many educators teach it as a first programming language.
Stability. Efficiency was a major selling point in the early days of SuperCollider, and today it
continues to rival many commercial and open source platforms in signal processing performance. The
language and server were architected for a high degree of real-time safety. For example, the server
has its own real-time safe memory allocator so that the creation and destruction of synthesizer
nodes is lightning fast (in particular avoiding system calls to malloc
and free
).
Free software. SuperCollider is made available under the GNU GPL. It's available at no cost, and maintained by a vibrant community of volunteer developers. Unlike most software of its age, SuperCollider development remains very active — as of 2019, SC averages several commits per week and has a regular release schedule. The SC developers are a friendly bunch and will often respond to tickets within hours.
Why this tutorial?
SuperCollider's learning curve is somewhat notorious. I won't mince words — SC is a fairly tricky program to pick up, and it often takes a long time to reach proficiency in it. This is not helped by the fact that the official tutorials in SuperCollider don't go very far. As a result, many SC educators have individually stepped up over the years with excellent learning materials. In particular, we'd like to shout out A Gentle Introduction to SuperCollider and Eli Fieldsteel's video tutorials.
"Learn SuperCollider" is a new effort to create an official community-written learning resources for the program, taking our favorite ideas from the above tutorials.
As SuperCollider 3 has evolved over its 15+ years of existence, multiple ways to accomplish the same thing have popped up in the language, and many older tutorials are inconsistent with each other. Learn SC is intended to be very opinionated and prescriptive concerning use of the SuperCollider language. We are big on recommending the best practices and discouraging older styles of SC code.
Another important focus of these books is to emphasize the musicality of SuperCollider. When new concepts are introduced, we emphasize how they can be used in music and sound design and celebrate the huge variety of workflows that SuperCollider offers.
Chapter 1
- Make a Calculator - essentially just demonstrating how this works, and explaining (which will be reiterated repeatedly) that precedence is left to right.
So let's start off by writing a very simple scale:
(
Pbind(
\midinote, Pseq([60, 62, 64, 65, 67, 69, 71, 72]),
\dur, 1
).play
)
Now type ctrl-enter (Windows and Linux) or Cmd-Enter (Mac).
[Put a picture of ctrl-enter and cmd-enter]
In the post window in the bottom right you should also see the following, while in the background you will hear a simple C major scale.
[TODO Screenshot]
Whenever you successfully evaluate a piece of code in SuperCollider, this window will give you a little bit of feedback about what just happened. Don't worry yet about what that means.
#Didn't Hear Anything?
If you see something different then there was probably something wrong with what you just typed in. Check it again, paying careful attention to placement of brackets and commas. In particular SuperCollider requires brackets to be balanced. If all else fails, try copy and pasting the code from the book. If that doesn't fix it there may a deeper problem. Contact the mailing list, forum or Slack channel [links to follow].
If you see the following, then you need to start the SuperCollider sound server:
[TODO Screenshot]
Finally, if you still don't hear anything then make sure that the volume is turned up sufficiently. I make this mistake more often than I'd like.
Explaining What Just Happened
So we're going to take the piece of code that you just ran [terminology - this is sometimes also called 'evaluating'] and examine each piece of it so that you understand what happened. If you're a confident coder then you can probably skim this part.
[Image with brackets colored]
So the code we just ran is surround by brackets. Whenever we surround code by brackets in the SuperCollider IDE this is our way of telling the IDE that we want it to run all the code between the brackets. Note that whenever you have an open parenthesis - you must have a matching closing parenthesis. So what happens if we remove one of those parentheses:
[Screenshots]
We get the mysterious parse error in interpreted text
, but also see that a little further
down we see unmatched ')' in interpreted text line 1 char 1
. So SuperCollider is telling us
that it didn't understand the code ('parse error'), where it thinks the problem starts ('line 1'
where the open paranthesis is) and what the problem is ('unmatched )' - that is we don't have a
closing parenthesis to match the opening one). If you put the parenthesis back and run the code
again you should now hear the scale played back.
Now place the cursor (the blinking horizontal line that marks where new text will appear) after the final parenthesis. See how the entire block is colored yellow. Now remove the final parenthesis. The yellow highlight disappears. This is another way that you can tell if a code block can be run, and if you have missing parentheses.
[IMAGE of BLOCK]
Restore the code block to it's initial state (hint: you can use undo to do this: ctrl-z
or
cmd-z
). When you reevaluate it it should play normally. Now let's look deeper. First of all what
is \dur
? This is short for duration, and tells SuperCollider that the code following the
comma (1
) should be used for the duration in beats of the next note.
\midinote
is used to tell SuperCollider that the code that follows the comma: Pseq([60, 62, 64, 65, 67, 69, 71, 72])
will generate 'midi notes'. MIDI notes are an industry standard
where particular numbers (these are defined as part of the MIDI standard [wikipedia link]) are
treated as musical notes. For example middle C is 60, D#/Cb is 61, D is 62, etc.
[Image of the Midi notes].
At this point hopefully you have guessed that Pseq
is being used to define our scale:
- 60 - C4
- 62 - D4
- 64 - E4
- 65 - F4
- 67 - G4
- 69 - A4
- 71 - B4
- 72 - C5
So this little bit of code has generated the following sequence of notes:
- C4 for a duration of 1 beat
- D4 for a duration of 1 beat
- D4 for a duration of 1 beat
- D4 for a duration of 1 beat
- E4 for a duration of 1 beat
- F4 for a duration of 1 beat
- G4 for a duration of 1 beat
- A4 for a duration of 1 beat
- B4 for a duration of 1 beat
- C5 for a duration of 1 beat
[Image of a simple ascending scale here]
Similarly the following piece of code will generate a descending C Major scale, where each note has a duration of 2 beats:
(
Pbind(
\midinote, Pseq([72, 71, 69, 67, 65, 64, 62, 60]),
\dur, 2
).play
)
[Image of a simple descending scale here]
If we want to vary the number of beats, then we use a Pseq for the \dur
key:
(
Pbind(
\midinote, Pseq([60, 62, 64, 65, 67, 69, 71, 72]),
\dur, Pseq([8, 4, 2, 1, 1/2, 1/4, 1/8, 1/16])
).play
)
[Image of what this is here]
Note that when we want to create eighth notes, or sixteenth notes we write it as a fraction (e.g.
1\8 for one eighth of a beat). We could also write these durations as decimal places if we liked -
0.5
and 1/2
are interchangable.
So what happens with the following code:
(
Pbind(
\midinote, Pseq([60, 62, 64, 65, 67, 69, 71, 72]),
\dur, Pseq([1, 2, 2])
).play
)
It plays C4 for 1 beat, D4 for 2 beats, E4 for 2 beats and then stops. So Pbind will keep playing
until one of the sequences runs out of notes to play. If we provided it with infinitely long
\midinote
and \dur
sequences then it would play for ever. One way that we can provide
such an infinite sequence is by providing a single value. The following will play for as long as
you let it (remember Ctrl/Cmd-period
will stop the audio server):
(
Pbind(
\midinote, 60,
\dur, 1
).play
)
So single values result in an infinite repeating sequence.
So now we have enough to create a simple tune:
[Twinkle Twinkle little star score]
// Twinkle Twinkle Little Star
(
Pbind(
\midinote, Pseq([60, 60, 67, 67, 69, 69, 67, 65, 65, 64, 64, 62, 62, 60,67, 67, 65, 65, 64, 64, 62,67, 67, 65, 65, 64, 64, 62,60, 60, 67, 67, 69, 69, 67, 65, 65, 64, 64, 62, 62, 60]),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2,1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2,1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2,1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2]),
).play
)
)
And hopefully after pasting this into your IDE, you should hear Twinkle Twinkle little star played at the very sedate pace of 60bpm. If you're thinking this is pretty verbose and annoying way to enter music, then let's fix that.
First of all note in the score above that the rhythm is a repeating motif of 6 quarter notes, followed by a half note. So now we can change the above to:
// Twinkle Twinkle Little Star
(
Pbind(
\midinote, Pseq([60, 60, 67, 67, 69, 69, 67, 65, 65, 64, 64, 62, 62, 60,67, 67, 65, 65, 64, 64, 62,67, 67, 65, 65, 64, 64, 62,60, 60, 67, 67, 69, 69, 67, 65, 65, 64, 64, 62, 62, 60]),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 6)
).play
)
So by passing in a second value to Pseq (separated from the array by a ,
) we were able to
tell SuperCollider to play this sequence 6 times in a row. We can't repeat the dur
trick, but
fortunately we have options available to us:
(
var a = [60, 60, 67, 67, 69, 69, 67, 65, 65, 64, 64, 62, 62, 60];
var b = [67, 67, 65, 65, 64, 64, 62];
Pbind(
\midinote, Pseq(a ++ b ++ b ++ a),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 6),
).play
)
So what was that? The first two lines create two new variables
called a
and b
respectively
and assign arrays to those labels. [Definition of an array to go here]. Then in Pseq we concatenate
those variables using ++
to create one large array:
(
var a = [1,2,3];
var b = [4,5,6];
a.postln;
b.postln;
a ++ b;
)
[TODO Previous chapter - explain parentheses]
In the post window you should see:
[ 1, 2, 3 ]
[ 4, 5, 6 ]
-> [ 1, 2, 3, 4, 5, 6 ]
a ++ b
creates a new array which combines a
and b
. So above we create a new sequence of
note values that consisted of a
followed by b
twice followed by a
again. There is another way
to achieve this, and when working with Pbind
this is generally preferred. We can use
Pseq
to chain several sequences together. So the above would be rewritten:
(
var a = [60, 60, 67, 67, 69, 69, 67, 65, 65, 64, 64, 62, 62, 60];
var b = [67, 67, 65, 65, 64, 64, 62];
Pbind(
\midinote, Pseq([Pseq(a), Pseq(b, 2), Pseq(a)]),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 6),
).play
)
Or if you prefer, you can use ++
to combine the patterns:
(
var a = [60, 60, 67, 67, 69, 69, 67, 65, 65, 64, 64, 62, 62, 60];
var b = [67, 67, 65, 65, 64, 64, 62];
Pbind(
\midinote, Pseq(a) ++ Pseq(b, 2) ++ Pseq(a),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 6),
).play
)
The last two pieces of code are interchangable - the way you write this comes down to personal preference (I personally prefer the latter). SuperCollider will convert the second piece of code into the the former for you.
Okay, so this is definitely better, but you probably don't know all the midinote numbers. Can we do better? Yes we can:
(
var a = Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]);
var b = Pseq([4, 4, 3, 3, 2, 2, 1]);
Pbind(
\scale, Scale.major,
\root, 0,
\octave, 5,
\degree, a ++ b ++ b ++ a,
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 6),
).play
)
So this time the numbers in our array correspond to notes in the C scale in the middle octave on
the piano (the octave that begins with middle C, or C4), with 0
for C4
, 1
, for D
all the
way to 8
for C5
. So let's explain the new keys in this Pbind
:
- scale - this Pbind uses the major scale. SuperCollider has pretty much any scale you can imagine. If you don't set this value then the default value is Scale.major.
- root - The key for this scale. 0 is C, 1 is C#, etc. The default is
0
. - octave - The default octave. 5 is confusing used for the octave that starts with
C4
. If you don't set the octave key, then5
is the default. - degree - The degree of the current scale, where 0 is the root note of the scale in the
current octave. In the above example if wanted to play
C3
then we would use the value-8
while C4 would be8
. We can also play sharps and flats. C# would be 0.1 - while Db is 0.9. C## (also known as D) would be 0.2.
So transposition is pretty easy. By key to G:
(
var a = Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]);
var b = Pseq([4, 4, 3, 3, 2, 2, 1]);
Pbind(
\scale, Scale.major,
\root, 7,
\octave, 5,
\degree, a ++ b ++ b ++ a,
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 6),
).play
)
So in the example above 0
means the value G4, as we're starting 7 intervals (or 7 notes in the
chromatic scale) above C4. The bass point that we're using is up the keyboard from middle C.
or to A minor (note that we went down to the A3 before C4):
(
var a = Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]);
var b = Pseq([4, 4, 3, 3, 2, 2, 1]);
Pbind(
\scale, Scale.minor,
\root, -3,
\octave, 4,
\degree, a ++ b ++ b ++ a,
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 6),
).play
)
We can even transpose it to a different mode, such as F Lydian, by using mtranspose
:
(
var a = Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]);
var b = Pseq([4, 4, 3, 3, 2, 2, 1]);
Pbind(
\scale, Scale.major,
\root, 0,
\octave, 5,
\degree, a ++ b ++ b ++ a,
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 6),
).play
)
Note that in the above example the scale and root are very important. As F Lydian
is built upon
the 4th degree of the C major scale, then we need to pass in a major scale and a root of 0
so
that we're using the C major scale. C lydian built upon C4
would require a root of F
and the
octave value of 4
and would look like this:
(
var a = Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]);
var b = Pseq([4, 4, 3, 3, 2, 2, 1]);
Pbind(
\scale, Scale.major,
\root, 5,
\octave, 4,
\degree, a ++ b ++ b ++ a,
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 6),
).play
)
See if you can reassure yourself that this is correct, and if you're interested in modal music try playing around with some other values.
If you don't understand what a mode is, don't worry about it. If you're interested, then this wikipedia article is a good place to start.
Important Everything written above assumes that you are working in equal temperment and using western scales. SuperCollider will happily support microtuning, Indian scales or anything else you can think of. Don't worry this will be explained in later chapters. For now you must remain shackled within conventional western notions of musicality...
Volume and Articulation
So far we've seen how to write a simple melody, but the results have been a little robotic. So in this section we're going to look at ways we can vary the amplitude (also known as velocity) and articulation of notes.
Stacatto to Legato
While \dur
controls the length of the note event, we can control the articulation of each note
with legato
:
(
// stacatto
Pbind(
\degree, Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 2),
\legato, 0.1
).play
)
(
// legato
Pbind(
\degree, Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 2),
\legato, 1
).play
)
and obviously we can vary the legato if we so desire:
(
Pbind(
\degree, Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 2),
\legato, Pseq([0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.9], 2)
).play
)
Volume
We can vary the amplitude directly with the \amp
key. Amplitude is a value between 0 (silence)
and 1 (maximum volume).
(
Pbind(
\degree, Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 2),
\amp, 0.5
).play
)
We can also vary it from note to note quite easily:
(
Pbind(
\degree, Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 2),
\amp, Pseq([0.8, 0.5, 0.6, 0.4], inf)
).play
)
This probably looks quite familiar except for one thing. What is this inf
value. This is
SuperCollider's way of defining infinity, and when used in a pattern in this way it tells
SuperCollider to repeat this pattern for ever. This is useful when you have a pattern that repeats
for the entirety of a piece, and you don't want to work out how many times it should repeat.
This works, if you remember, because Pbind stops creating new note events when one of it's patterns ends.
\amp
isn't the only key that defines the amplitude. Pbind
also supports the \db
key. This value allows you to define the value in decibels.
[Explanation of decibels go here.]
(
Pbind(
\degree, Pseq([0, 0, 4, 4, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0]),
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 2),
\db, Pseq([-2, -4, -3, -6], inf)
).play
)
Chords
So far all we've played has been melodies. But music would pretty uninteresting without harmony. Fortunately creating chords and chord progressions in SuperCollider is pretty straightforward.
A C Chord
So let's play one chord every bar:
// C - G progression for infinity
(
Pbind(
\midinote, [60,64,67],
\dur, 4).play
)
Contrast this with a pattern that plays a single note:
// C - G progression for infinity
(
Pbind(
\midinote, 60,
\dur, 4).play
)
The only difference between them is we now have three notes in an array. If you remember, an array is a data structure that contains multiple data items in a sequential 'list'. Creates an event for each value in the array and plays them simultaneously. In this case it results in a chord being played.
Simple Chord Progression
If we want to create a chord progression, we can just use Pseq and play back multiple arrays, rather than single values:
// C - G progression for infinity
(
Pbind(
\midinote, Pseq([[60,64,67], [67,71,74]], inf),
\dur, 4).play
)
Note that the first parameter of Pseq
is an array of arrays: [[60, 64, 65], [67,71,74]]
rather than a single array like we have seen before.
Of course, just as before, we can specify the chord using \degree
:
// C - G progression for infinity
(
Pbind(
\root, 0,
\degree, Pseq([[0,2,4], [4, 6, 8]], inf),
\dur, 4).play
)
and we could even cycle through a cycle of 5ths:
(
Pbind(
\root, Pseq([0, -7, -2, 3]),
\degree, [4, 6, 8],
\dur, 4).play
)
Harmonizing a Melody
So now let's look at how we can harmonize an existing melody by returning to old standby - Twinkle Twinkle Little Star.
So first of all let's create our chord progression:
(
var c = [0, 2, 4]; // C E G
var f = [0, 3, 5]; // C F A
var g7 = [-1, 1, 3, 4]; // B D F G
var progA = Pseq([c, f, c, f, c, g7, c]);
var progB = Pseq([c, f, c, g7, c, f, c, g7]);
var a = [60, 60, 67, 67, 69, 69, 67, 65, 65, 64, 64, 62, 62, 60];
var b = [67, 67, 65, 65, 64, 64, 62];
var prog = Pbind(
\octave, 5,
\degree, progA ++ progB ++ progB,
\dur, Pseq([4, Pseq([2], 14), 4, Pseq([2], 6)]));
So hopefully this all looks fairly similar to how we created melodies in a previous chapter. All that's changed here is that now we are playing a chord, rather than a single note. Now let's add the melody:
(
var c = [0, 2, 4]; // C E G
var f = [0, 3, 5]; // C F A
var g7 = [-1, 1, 3, 4]; // B D F G
var progA = Pseq([c, f, c, f, c, g7, c]);
var progB = Pseq([c, f, c, g7, c, f, c, g7]);
var a = [60, 60, 67, 67, 69, 69, 67, 65, 65, 64, 64, 62, 62, 60];
var b = [67, 67, 65, 65, 64, 64, 62];
var prog = Pbind(
\octave, 5,
\degree, progA ++ progB ++ progB,
\dur, Pseq([4, Pseq([2], 14), 4, Pseq([2], 6)]));
var melody = Pbind(
\midinote, (Pseq(a) ++ Pseq(b, 2) ++ Pseq(a)) + 12,
\dur, Pseq([1, 1, 1, 1, 1, 1, 2], 6),
);
Ppar([melody, prog]).play
)
So here you can see we have a new pattern type: Ppar
. Ppar allows us to play two independent
patterns simultaneously - allowing us to construct more complex musical arrangements. As we'll see
in future chapters - pattern constructs such as this allow us to flexibly and quickly build up
complex musical arrangements quite easily.
Auld Lang Syne Probably
https://www.8notes.com/scores/1476.asp
block chords (nothing fancy)
[Verse]
C G
Should auld acquaintance be forgot
Am F
And never brought to min'?
C G
Should auld acquaintance be forgot
F G C
And days of auld lang syne?
[Refrain]
C G
For auld lang syne, my dear
Am F
For auld lang syne
C G
We'll tak' ae cup o'kindness yet
F G C
For auld lang syne
Simple Subtractive Synthesis
In this chapter we're going to show you how to make a simple subtractive synthesizer. For a lot of musicians this is what they mean when they mean a synthesizer. In their heads they will think of maybe a Moog synthesizer, with a nice low pass filter and some simple envelopes. While SuperCollider can do a lot more than this, subtractive synthesis is certainly possible.
What is Subtractive Synthesis
If you already know how subtractive synthesis works then feel free to skip this section. In this section we're just going to give a high level description of what subtractive synthesis is, and how you use it.
TODO:
- Types of oscillator and their wave forms
- Low pass filter
- Envelope
- For amplitude
- For filters
- High Pass Filter
Should probably be reasonably graphical - and would be good to have sound samples here as well.
Hello Synth
So let's build a really simple synthesizer with a single oscillator:
(SynthDef(\HelloSynth,
{
Out.ar(0, SinOsc.ar(440));
}).add);
Evaluate this block. Now let's play this synth:
Synth(\HelloSynth)
Hopefully you should now hear a simple test tone on your left speaker.
When you get sick of it you can stop the synth by pressing ctrl-.
on Windows/Linux, or
cmd-.
on OSX.
So what is going on here? In our first bit of code SynthDef defines a synth template imaginatively
called HelloSynth
. This doesn't create a synth, or make any sound on the server. Instead it
provides a template that can be used for creating synths. The way way we create a synth is by a call
to Synth
, passing in the name of our synth template.
NOTE: When we name a synth, or a template, we preceed the name with a backslash: ''. A user defined label preceeded by a backslash is called a symbol. Here are some examples of a symbol:
\MySymbol
BestSynth
You may remember that we used symbols previously when we were looking at Pbind
. There a symbol
was used as a key, and this is also a common thing you will see in SuperCollider. Don't worry if
this isn't superclear - as you see more examples this will become clearer.
In the SynthDef
everything surrounded by {
and }
is the synth definition. The
diagram below shows you the block structure for this synth definition:
[DIAGRAM]
Out.ar pipes the sound generated by the synth to the audio SuperCollider infrastructure. If you're familiar with modular synthesis - if you think of the synth as a module, then Out.ar is the output from the module (if you're not familiar don't worry, hopefully things will become clearer shortly).
Out.ar
takes two parameters:
- Audio bus number - In this case bus number 0.
- Sound source - In this case the output from the SinOscillator.
If we change the bus number
the output will go somewhere else. If you change 0
above to 1
you
should now hear the test
So what are defining in the SynthDef
?
Oscillations all Around
In the previous
A Playable Synth
So far our synth doesn't do much
Building a Simple Moog Synth
Fair warning - this won't sound enormously like a Moog, but the principles are the same.
A little bit more analog
Let's face it, true analog synths have a little bit more grit than this. Fortunately SuperCollider
does have one filter which sounds characteristically dirty: DFM1
.
So let's plug it into our synth below.
- mention that it takes resonance, rather than Q
- input gain will overdrive it (demonstrate that with a pattern)
- Noiselevel can also make it sound noisier if that's something you want.
- Finally, can also use it as a high pass filter.
Limitations of SuperCollider
Currently SuperCollider does not have really nice analog modelled filters beyond DFM1 (which you saw above). There are some filters which do sound more analog:
- RLPFD - A 909 emulation
- Moog filters (need to make a recommendation about which is the best) - these are reasonable for high frequencies, but won't give you the characteristic Moog growl at low frequencies.
This is a recognized limitation currently and is something that is being worked on - but for the moment if you really want good analog modelling then soft synths (or hardware) are the way to go. As you'll see in a later chapter SuperCollider can interface quite nicely using MIDI, so all is not lost.