Languages for Computer Music

Roger B. DannenbergFrontiers Digit. Humanit 2018

Abstract

While general-purpose programming languages focus on computing answers as fast as possible, music languages must compute answers at exactly the right moment. This review explores how specialized languages like ChucK, SuperCollider, and Faust treat "time" as a first-class citizen, enabling composers to manage complex concurrency and high-speed audio synthesis without being expert software engineers.

Introduction

In traditional computer science, the goal is efficiency: minimizing the time a program takes to run. In music, however, precision is more critical than raw speed. Music is inherently parallel—multiple voices singing at once—and exists strictly over time.

Roger Dannenberg, a pioneer in the field, explains that general-purpose languages often struggle with the "temporal semantics" required for music. While a 10-millisecond lag in a spreadsheet calculation goes unnoticed, the same lag in audio generation results in an audible glitch. This paper surveys the specialized abstractions—such as logical time, unit generators, and data-flow graphs—that allow computers to handle the unique demands of real-time sound and composition.

Conceptual Models and Methods

The computer music community has developed several key conceptual models over the last 60 years to address these challenges:

  • Logical Time Systems: These systems distinguish between "physical time" (the wall clock) and "logical time" (the score). This allows a system to "catch up" if it falls behind or schedule events precisely on the beat, regardless of CPU load.
  • Unit Generators: These are the building blocks of sound, such as oscillators and filters. They are connected in a "data-flow graph" where samples stream synchronously from one node to the next.
  • Concurrency Models: Languages like ChucK and FORMULA use non-preemptive threading models (e.g., "shreds"). This ensures that threads only advance when they explicitly "sleep" for a specific duration, preventing the race conditions common in standard multi-threading.
  • Paradigm Shifts: The field sees a tension between Functional Programming (treating sounds as values, as in Nyquist) and Object-Oriented Programming (treating sounds as stateful objects, as in CLAM).

Key Insights: Time and Syntax

A core tenet of these languages is treating Time as a First-Class Citizen. In languages like ChucK, timing is part of the syntax rather than a side effect; code execution can be halted until a specific amount of logical time has passed.

Furthermore, the paper highlights the success of Visual vs. Textual Syntax. Graphical languages like Max/MSP and Pure Data (Pd) represent signal flow as "patch cords" between boxes, making complex digital signal processing (DSP) accessible to non-programmers.

Examples of visual programming syntax showing signal flow and control logic.

Historical Evolution and Taxonomy

The paper provides a taxonomy of how different languages solve the "time" problem, tracing a lineage from the 1950s to the present day:

  • Music N (1957–present): Established the "unit generator" model used in almost every synthesizer today.
  • SuperCollider: Introduced the power of separating the "Client" (language/control) from the "Server" (synthesis engine), allowing for massive scalability.
  • Faust: Demonstrated that high-level functional languages can compile into C++ code as efficient as hand-written assembly for signal processing.
  • Nyquist: Introduced "temporal semantics" to Lisp, allowing sounds to be transformed as easily as integers.
A timeline of representative and historically significant computer music languages from 1957 to the 2010s.

Future Challenges

Despite these advancements, several hurdles remain for the next generation of music languages. The "Third Language" problem persists: while we have languages for scores and synthesis, a lower-level language like C++ is often still required to write the actual unit generators. Additionally, debugging real-time audio code remains notoriously difficult. Future languages will need better "transparency"—tools that allow developers to visualize signals and messages moving through complex graphs in real-time—and more natural ways to describe the interaction between discrete events (like key presses) and continuous signals.

Summary updated

BibTeX
@article{dannenberg2018languages,
  author = {Roger B. Dannenberg},
  title = {{Languages for Computer Music}},
  journal = {Frontiers Digit. Humanit.},
  year = {2018},
  doi = {10.3389/fdigh.2018.00026},
}
Figure