Table Of ContentIntroduction to
SuperCollider
Andrea Valle
IntroductiontoSuperCollider
BibliographicinformationpublishedbytheDeutscheNationalbibliothek
TheDeutscheNationalbibliothekliststhispublicationintheDeutscheNationalbibliografie;
detailedbibliographicdataareavailableontheInternetathttp://dnb.d-nb.de.
©CopyrightAndreaValle&LogosVerlagBerlinGmbH2016
Allrightsreserved.
ISBN978-3-8325-4017-3
LogosVerlagBerlinGmbH
Comeniushof,GubenerStr.47,
10243Berlin
Tel.:+49(0)3042851090
Fax:+49(0)3042851092
Web:http://www.logos-verlag.de
PDFversion:
site:http://logos-verlag.de/ebooks/IntroSC/
user:introsc
password:Super0616Collider!
TranslatedfromItalianbyMarinosKoutsomichalisandAndreaValle.
EnglishrevisionbyJoeHighamandJoshuaParmenter.
Italianedition:
ApogeoEducation,Maggiolieditore,Milano,2015
ISBN:978-88-916-1068-3
TypesetwithConTEXtandSuperColliderbyAndreaValle
Contents
1 GettingstartedwithSuperCollider 1
1.1 AboutSuperCollider 1
1.2 SCoverview 3
1.3 Installationanduse 6
1.4 Objectives,references,typographicalconventions 9
2 ProgramminginSC 13
2.1 Programminglanguages 13
2.2 Minimaobjectalia 16
2.3 ObjectsinSC 19
2.4 Methodsandmessages 26
2.5 Themethodsoftypepostanddump 33
2.6 Numbers 36
2.7 Conclusions 39
3 Syntax: basicelements 41
3.1 Brackets 41
3.2 Expressions 42
3.3 Comments 43
3.4 Strings 44
3.5 Variables 45
3.6 Symbols 49
3.7 Errors 51
3.8 Functions 52
3.9 Classes,messages/methodsandkeywords 57
3.10 Agraphicexample 59
3.11 ControlStructures 64
3.12 YetanotherGUIexample 67
3.13 Conclusions 71
4 Synthesis,I:FundamentalsofSignalProcessing 73
4.1 Afewhundredwordsonacoustics 73
4.2 Analogvs. digital 76
4.3 Synthesisalgorithms 81
4.4 MethodsofSignal 89
4.5 Othersignalsandotheralgorithms 93
4.6 Stillonsignalprocessing 105
4.7 Controlsignals 109
4.8 Conclusions 117
5 SCarchitectureandtheserver 119
5.1 Clientvs. Server 119
5.2 Ontologyoftheserverasanaudiosynthesisplant 123
5.3 Theserver 132
5.4 SynthDefs 134
5.5 UGensandUGengraphs 138
5.6 SynthsandGroups 144
5.7 Atheremin 149
5.8 Anexampleofreal-timesynthesisandcontrol 151
5.9 Expressivenessofthelanguage: algorithms 154
5.10 Expressivenessofthelanguage: abbreviations 156
5.11 Conclusions 160
6 Control 161
6.1 Envelopes 161
6.2 Generalizingenvelopes 167
6.3 Sinusoids&sinusoids 174
6.4 Pseudo-randomsignals 180
6.5 Busses 184
6.6 ProceduralstructureofSynthDef 197
6.7 MultichannelExpansion 201
6.8 Conclusions 208
IntroductiontoSuperCollider
7 Organizedsound: scheduling 211
7.1 Server-side,1: throughUGens 211
7.2 Serverside,2: DemandUGen 217
7.3 Language-side: Clocksandroutines 221
7.4 Clocks 226
7.5 Synthesizersvs. events 229
7.6 Graphicinterlude: drawingsandanimations 236
7.7 Routinesvs. Tasks 239
7.8 Patterns 243
7.9 EventsandEventpatterns 252
7.10 Conclusions 260
8 Synthesis,II:introductionto
basicreal-timetechniques 261
8.1 Oscillatorsandtables 261
8.1.1 Synthesisbysampling 269
8.1.2 Resamplingandinterpolation 271
8.2 Directgeneration 275
8.2.1 Synthesisbyfixedwaveform 276
8.2.2 Modulation 277
8.2.3 RingandAmplitudemodulation 278
8.2.4 Ringmodulationasaprocessingtechnique 280
8.2.5 Frequencymodulation 285
8.2.6 C:Mratio 288
8.2.7 Waveshaping 292
8.3 Spectralmodelling 297
8.3.1 Additivesynthesis 297
8.3.2 Subtractivesynthesis 305
8.3.3 Analysisandresynthesis: Phasevocoder 311
8.4 PhysicalModeling 319
8.5 Time-basedmethods 327
8.5.1 Granularsynthesis 328
8.5.2 Techniquesbasedonthedirectgenerationofthewaveform 331
8.6 Conclusions 335
9 Communication 337
9.1 Fromservertoclient: useofcontrolbuses 337
9.2 Fromservertoclient: useofOSCmessages 341
9.3 OSCtoandfromotherapplications 346
9.4 TheMIDIprotocol 349
9.5 Readingandwriting: File 353
9.6 Pipe 359
9.7 SerialPort 362
9.8 Conclusions 365
Foreword
MyfirstencounterwithSuperColliderdatesbackto2002,thankstomyfriend
Hairy Vogel, one of its first (and bold) users. At that time, I remember being
deeplyimpressedbythesoundquality,theseamlessintegrationbetweenaudio
synthesis and algorithmic composition, the native real-time operating mode.
So, I decided to buy an Apple computer, as SuperCollider 2 was working on
MacOS9systemsonly,whileSuperCollider3,thathadjustbecomeopensource,
was still an unstable release, porting to Linux had just begun (as far as I can
remember)andtherewerenoplansatallforaWindowsversion Butin2002
I was lacking some basic skills to be productive on SuperCollider, so I left it
momentarily, to get back to it in 2005. In 2008 I switched to Sup…erCollider in
my class for the Multimedia and Arts program (DAMS) at the University of
Turin. I was not able to find a basic, yet comprehensive resource to use for
teaching. Comprehensiveofwhat? Thisisofcoursethemainpoint. Myclass
is a basic introduction to computer music, so I was in need of reference for
both some basic notions in DSP and SuperCollider. Still, I was confident that
the latter was the apt tool to approach the former. Yet, introducing SC is to
alsointroducecomputerlanguagesingeneralandcertainnotionsconcerning
computersciencetoutcourt(e.g. theclient/networkarchitecture). Thatiswhy
I decided to write this book the scope of which is, consequently, too broad to
offercompletenessinanyofeachsubjects. Fromaverypersonalperspective,I
havetoconfessthatIhavetriedtowritethebookthatIwishedtohavewhile
startingwithSuperCollider. Myhopeisthatsomeonemightbeinneedofitas
Iwas.
OriginallywritteninItalianin2008inanelectroniconlyversion,thebook
hasbeensubstantiallyre-editedandupdatedtoaccountfortheSC3.7version
in2015, andthen, revisedandtranslatedintoEnglishin2016tobepublished
inaprintedversionthankstoLogosVerlag. IthasbeentranslatedintoEnglish
by myself and Marinos Koutsomichalis, thanks also to the support of the Su-
perCollider community. A crucial help on language and content revision has
beenprovidedbyJoeHighamandJoshuaParmenter. Iamdeeplythankfulto
Marinos,JoeandJoshfortheirwork.
SuperColliderhasastrong,supportingandpassionatecommunity. With-
out it, my journey with SC probably would have ended very soon. So, I am
profoundly indebted to all its members. Finally, a special “grazie” to James
McCartneytohavehisideassupercollideinhiswork.
Ciriè,Turin,May27,2016
1 Getting started with SuperCollider
1.1 AboutSuperCollider
SuperCollider(SC)isasoftwareenvironmentforreal-timeaudiosynthesisand
interactivecontrol. Itrepresentsthestateoftheartinaudioprogrammingtech-
nologies: asofwriting,thereseemstobenoothersoftwaresolutionwhichis,
atthesametime, equallyeffective, efficientandflexible. Yet, SCisoften, and
rightly,approachedwithsuspicionandwithawe: SCisnotexactly“intuitive”.
Inthefirstplace,theinterfaceistextual. InSuperCollidertheuserissupposed
to write, which is difficult enough for the typical computer-user who is nor-
mallyusedtoseeing(andinteractingwithGUI)andnotinmanipulatingand
reading raw code. Then, like all software solutions to advanced audio com-
puting,SuperColliderprerequisitesinsoundsynthesisandalgorithmicmusic
composition,aswellasincomputerprogramming. More,itdemandsthorough
understandingofcertaininformatics-derivedconcepts. However,theseosten-
sibleobstaclesareinrealitythetruepowerofSC:therewouldbenootherway
toarriveatasystemequallyversatileinsoftwaredesign,efficientincomputer
modeling,andexpressiveintermsofeasytousesymbolicrepresentations.
SuperCollider was originally developed by James McCartney in 1996 for
theMacintoshplatform. Version2,inparticular,hasbeendesignedfortheMa-
cOS9operatingsystem. SuperCollider3(whichis,atthesametime,verysim-
ilarandyetverydifferenttoSC2)hasbeendevelopedinitiallyfortheMacOS
Xoperatingsystem,butisnowanopensourceprojectthatrevolvesarounda
communityofcontributingprogrammers. Thiscommunityofdevelopershas
2 GettingstartedwithSuperCollider
beenresponsibleforportingSCinWindowsandLinuxoperatingsystems. Ac-
cordingly, we witnessed major changes in the software during the last years,
notintermsofthecorefunctionality(whichalbeithavingbeenimproved,isef-
fectivelythesame)butmorespecificallytheuserinterface. Thefirstversionsof
SCforotherplatformshavebeenlessfeaturedthantheOSXversion. Thevari-
ousLinuxversionshavebeengraduallyalignedwiththeOSXversioninterms
offunctionality,yetanduntilrecently,theiruserinterfacehasbeenverydiffer-
ent. Onthisaspect,thevariousWindowsversionsusedtobelessintuitivethan
theLinux/OSXversionsinvariousrespects. Thissituationhasbeenradically
changed with the introduction of the new Integrated Development Environ-
ment(IDE)(asfromversion3.6)andofthenewhelp-system(asofversion3.5).
From3.6onwards,SClooksandworksidenticallyonallthreeplatforms,this
wayprovidingaconsistentuserexperience1.
WhatcanwedowithSuperCollider? TheSCcommunityishighlydiverse,
SCbeingsuccessfullyusedforliveimprovisation,GUI-design,dance-oriented
music, electroacoustic music composition, sound spatialization, audio-hard-
wareinteraction,scientificsonification,multimediaornetworkbasedapplica-
tions,theperformanceofdistributedsystemsandforallsortsofotherapplica-
tions. Therehavebeenreal-lifeexamplesonalltheaforementionedcasesthat
havebeenmadepossibleeitherwithSCaloneorwithrespecttoparadigmsthat
emergedfromwithinit. Forinstance,theso-called“livecoding”paradigm—an
improvisationpracticewheretheinstrumentalperformance(touseacontextu-
allyuncanny,albeitnoterroneousexpression)isbasedonthewriting/editingof
codeinreal-timetocontrolsound-generatingprocesses2. Livecodingpractices
thatarenowbeingencounteredinvariousotherenvironments,haveemerged
withinSuperCollider(theyare,somehow,inherenttoitsnature). Another“eso-
teric”andSC-specificprojectisSC-Tweet: musiciansaresupposedtocompose
using code of a maximum size of 140 characters (the size of a “legal” tweet).
Ithastobenotedthatsuchmicroprogramsoftenresultinsurprisingcomplex
1 Inreality,SCishighlycustomizablewithrespecttointrinsiclanguagefeatures.
2 Thereferencesiteis
http://toplap.org
.