Emergent Music

Thu 18 August 2016

One of the things that I have been working on for a while is music composition in an algorithmic or generative style.

I have a site devoted to music (emergentmusics.org) which explains the models and theories behind these compositions (all of the music can be freely downloaded there). Here I will give the briefest of adumbrations; those interested can explore the work in-depth at the site.

I have termed the structure I work in emergent music -- because the work is informed by current work in self-organization, self-emergence, and complexity theory -- and the theory behind it A Theory of Emergent Music.


Self-organization and emergent properties can arise from systems that embody a few general principals:

  1. Local, independent parts comprise the overall system
  2. Local parts can act locally and influence adjacent parts
  3. Little or no global knowledge or action occurs
  4. Fully decentralized

In previous work with generative music often a multiplicity of parts was employed, but their interactions were greatly constrained, usually owing to the technology and techniques employed. A work could be created from a collection of tape loops playing independently, for example, but in general there was no way that one part could affect the execution of a different part; they remained more-or-less independent. When there was interaction is was usually mediated outside the system, i.e. by the composer or performers.

With today's technologies there is no reason to stay within this constraint of independence.

In order to effect the kinds of interactions through which emergent phenomena can spring the theoretical system I work within contains two types objects: notes and processes. A note is an embodiment of a sound, and a process is a transformation, which can be applied to any note or, importantly, any process (including, recursively, itself). This latter fact is what affords the opportunity for interdependent emergence.


Within the theory a note is defined as a point in a multi-dimensional space spanned by the following axes:

  • Pitch
  • Timbre
  • Volume
  • Time
  • Duration

These dimensions can be either continuous or quantized, linear or curved, with the decision as to how a dimension is characterized made from considerations of musicality and/or expressive intent. As an example, volume will in general be a continuous dimension with minima and maxima. Pitch can also be continuous (for example, within a micro-tonal composition), but in general is usually quantized according to some extant musical scale. In general timbre is a quantized dimension, with position denoting the voice in which a note will be played.

A dimension of space is curved when, like a circle or sphere, one ends up back at the same place when one travels far enough. I have found great use, for example, in curving the pitch space, so that the pitches sounded are appropriate for the voice on which they are played and which roll over once an upper or lower limit is passed.


A process is a transformation that can be applied to a note or process and builds upon the metaphoric spacial representation of notes by mirroring the types of transformations that can be applied to multi-dimensional spaces. Examples of these transformations include:

  • Translation: a note or process can be translated along an axis
  • Replication: Notes or processes can be replicated
  • Reflection: Movement in an axis can be reflected (for example, a melodic phrase that moves forward in time can be reflected to move backwards in time)
  • Dilation: An axis can be expanded or contracted

Notes and processes both have context, which is embodied by the spacial position of the object. But importantly the notes and processes do not have access to knowledge of their current context. This is important because such knowledge would represent global knowledge, which is minimized in this system. As an example, a process rule could be something like this:

Take the following object and replicate it three times, placing each replication one unit forward in time

But it would not look like:

Take the following object and replicate it, placing it at t=50 along the time axis

because the latter assumes access to global state. In other words, to ensure local action processes and notes work with relative spacial relationships (specifically relative to their current state), not absolute relationships and measures.


To implement the theory a context-free grammar was created (with syntax inspired by the Context-Free Art project). An interpreter was written (in Python) which transformed expressions in this grammar to MIDI files, which were in turn used to render the music.

The actual grammar and implementation is explored more fully at the Emergent Musics site, but I'll give a brief example here.

What follows is the score to Opening, which was released on the album Emergent Musics.

start begin

set volume      100
set scale       (2 2 3 2 3) 50
set tempo       38
set wrapnotes   True
set maxnotes    5000
set duration    1.0
set timerange   (9 230)
set numtracks   10
set wraptracks  True
set pitchrange              (-8 16)
set trackpitchrange     2   (-3 11)
set trackpitchrange     6   (-3 6)
set trackpitchrange     7   (-3 6)
set trackpitchrange     9   (-3 6)

### Process Definitions
process begin {
    8 * (time 24 pitch 2 track  1) outerwrap
    4 * (time 12 pitch 2 track -1) melody tfactor 4
process outerwrap {
    6 * (time 6.125 pitch  4 track  1) wrap
    6 * (time 8.125 pitch -2 track -1) melody time 2
process wrap {
    12 * (time 3.25 volume -10) melody
### Melodic Fragment
process melody {
    note time 0.0 pitch 4 duration 0.5 volume -10
    note time 0.5 pitch 8 duration 0.5 volume  10
    note time 2.0 pitch 4 duration 0.5 volume   0
    note time 3.0 pitch 6 duration 0.5 volume -10
    note time 4.5 pitch 4 duration 0.5 volume -20
    note time 5.5 pitch 3 duration 0.5 volume -30
    note time 6.0 pitch 1 duration 1.0 volume -40

There is one melodic fragment (of seven notes) and three higher-level processes defined.

The first stanza defines where in the multi-dimensional space the composition will begin, and the next stanza defines the space in which the composition will unfold. For example, the line set wrapnotes True defines pitch as a curved space, and the line set trackpitchrange 2 (-3 11) defines -3 and 11 as the minimum and maximum value for the pitch scale of voice 2 (the value 0 is pinned to MIDI note 50 in the set scale command.

As an example of the process definition, this process:

process wrap {
    12 * (time 3.25 volume -10) melody

Take the process melody (which is a collection of notes), and replicates it 12 times, each time shifting the replication's position in both the time and volume dimension.

This the what the composition sounds like:

The full album, along with more explication on the theory and implementation, can be found at the Emergent Musics site.