The Ecosystem#

[The fundamental contribution of the computer to music is that it empowers the composer to] hear that which could not be heard without the computer, to think that which could not be thought without the computer and to learn that which could not be learned without the computer. The computer can allow a composer to write music that goes beyond that which she is already capable of. – Paul Berg [Ber87]

SuperCollider (SC) is a package and a platform that consists of three components:

  • scsynth: a real-time audio server or synthesis engine, i.e., the part that creates and plays the sound. It is written in C++ and combines UGens according to pre-made declarative descriptions, SynthDefs, instantiating them as Synth, which can be dynamically created and destroyed. scsynth is a separate process and communicates with sclang via Open Sound Control (OSC) messages.

  • sclang: an interpreted object-oriented programming language (OOP) for sound creation and signal processing with some features of functional programming. The user controls the audio server (scsynth) by sending OSC messages to it.

  • scide: a powerful Integrated Development Environment (IDE) for programming in sclang. It offers an integrated help system, analyzing tools, and extensive documentation.

SuperCollider (SC) is written in C++ and was developed by James McCartney. It was released in 1996. In 2002 McCartney transformed it into a free and open software project under the GNU General Public License. It is still maintained and developed by an active community.

Blocks of code are evaluated in real-time by the sclang interpreter. The SuperCollider standard class library includes, besides the general purpose abstractions such as collections, powerful procedures for algorithmic creation of UGen graphs and rich abstractions for musical events (routines, patterns, etc.).

../../_images/architecture-dark.png

All three parts of SuperCollider (SC) are independent, i.e., there might be some other subsystem that replaces some of its features. One can code by using other IDEs such as VSCode. We can also use sclang independently to program applications that have nothing to do with signal processing. These use cases are rare. However, we find many projects that replace sclang and scide, especially in the area of live programming, for example:

  • Sonic Pi: highly accessible and therefore fascinating in the context of education.

  • TidalCycle: functional language that focuses on the creation of complex rhythms via pattern.

  • FoxDot: similar to TidalCycle but focuses more on the melodic side of compositions.

  • Sardina: a Python based live coding library

  • Overtone: open source audio environment designed to explore new musical ideas from synthesis and sampling to instrument building, live-coding and collaborative jamming

  • ORCA: esoteric programming language designed to quickly create procedural sequencers

  • Punkt: live coding music library/environment for Kotlin, for software developers who want to dive into live coding music

In that case, we can develop our synths using sclang and run them on the server scsynth, but we control them by these systems. If we are only interested in using existing synths and samples, we can do so without relying on SuperCollider (SC). Furthermore, there are many more projects that use their own audio server, i.e., do not rely on SuperCollider:

  • ChucK: strongly-timed, concurrent, and on-the-fly music programming language

  • Gibber: live coding environment for the web browser

  • Gwion: a programming language designed for making music and sound inspired by ChucK but also has a REPL mode you can use for live-coding

  • GLICOL: a graph-oriented live coding language written in Rust (I have my eyes on that project ;)!)

Of course, deciding between Sonic Pi, TidalCycle, FoxDot, or any other environment/language and plain SuperCollider (SC) comes down to personal preference and goals. The sclang is rather close to the metal. It offers a lot of control but might be less productive if you want to get things done quickly. Each platform targets different objectives and has various advantages as well as disadvantages. In my opinion, SuperCollider (SC) is the most powerful one but can be less intuitive and flexible, especially for a collaborate live coding experience. I encourage readers interested in live coding to check them all out!

The Audio Server#

The real-time audio server scsynth forms the core of the platform. The server uses synth definitions, i.e., SynthDefs as templates for creating synth nodes. Those synth instances can then be executed. A SynthDef represents a signal-flow-graph and executing a synth equates with creating an instance of a specific SynthDef, i.e., such a graph. The user can trigger and influence the execution via OSC messages. For example, one can change the arguments of a SynthDef while the synth is executed. In fact, many sclang classes abstract away the explicit communication via OSC messages.

Very similar to object-oriented programming, a SynthDef is a blueprint for a synth instance. The composer

  1. defines the blueprint, that is, a SynthDef,

  2. adds the blueprint to the server,

  3. creates a new instance, that is, a synth,

  4. and executes, controls, and terminates it.

All those steps are done via the client-side interpreted programming language sclang. It abstracts away thus simplifies the communication with the audio server such that we do not have to write pure OSC messages.

Tha Language#

The interpreted programming language sclang is an objective-oriented programming language. It is similar to Smalltalk or Ruby with syntax similar to C or JavaScript. sclang is dynamically typed and has its own garbage collector. Functions are first-class objects and everything is an object, i.e., there are no primitive data types.

From a musical point of view, it has its own interactive programming and lives coding packages and a subsystem for composing patterns and signal graphs. Its strength lies in opening up the possibility of dealing, creating, manipulating, and combining signal-flow graphs. One has to get used to its aged syntax.

The Development Environment#

The SuperCollider (SC) integrated development environment (IDE) is a Qt-based cross-platform application. Code can be executed in a notebook-like manner, i.e., interactively using the REPL (Read–Eval–Print Loop).

../../_images/ide.png

Fig. 2 The scide.#

The IDE offers some useful tools such as

  • the Node Tree displays the synth running currently on the server Server.local.plotTree;

  • a Levels displays the current volume/amplitude for each channel Server.local.meter;

  • a Stethoscope displays the scope of the current signal Server.local.scope;

  • a Freq Analyzer that displays the frequencies of the current signal FreqScope.new;

  • a Server displays useful information about the server such as the CPU workload Server.local.makeWindow;.

../../_images/ide-tools.png

Fig. 3 Different scide tools for analyzing and observing what is going on. One synth is running (a sine wave of 220 cycles per second).#

These tools are depicted in Fig. 3. They can be used to observe and analyze the state of the server as well as the signal processing.