Friday 2 November 2001

Chaos and the Musical Geometry of Nature

"`...I believe there must be a form of music inherent in nature, in objects, in the patterns of natural processes'." (Douglas Adams, Dirk Gently's Holistic Detective Agency, page 147).
The study of chaotic systems began in the early 1960s when Edward Lorenz, a meteorologist at the Massachusetts Institute of Technology, stumbled upon a bizarre phenomenon. At the time, he was working on mathematical models for weather prediction and had developed a simple set of equations which governed the behaviour of an artificial meteorological system.

One day, he wanted to analyse a particular run of the system again. Rather than start the sequence from the beginning, he took a printout of a previous run and typed in the numbers from midway through that run. Then he went off for a cup of coffee (although his computer was the size of a fridge, it had only 16KB of memory and could only calculate at a rate of 60 multiplications a second).

What he found when he returned has generated an entire field of scientific research. The data produced by the system should have exactly reproduced the patterns of the previous run since that run started from the same state. In fact, the generated sequence diverged steadily from the previous run to the point where all resemblance had disappeared. He initially thought that one of the valves in his computer must have blown. However, this would have led to a sharp change in the behaviour of the system.

Lorenz eventually discovered that this effect was due to the short-cut he had taken: while the computer stored numbers to a precision of six decimal places (e.g., 4.389204), the printout that he took the figures from only depicted three (e.g., 4.389). He had uncovered one important property of chaotic systems: their overall behaviour is incredibly sensitive to minute changes in the initial conditions.

This phenomenon has given rise to the famous notion of the Butterfly Effect: a butterfly flapping its wings in London today can influence storms in Australia next week. It also means that it is literally impossible to know the current weather conditions with enough accuracy to make totally reliable forecasts.

"You see, a pattern of numbers can represent anything you like, can be used to map any surface or modulate any dynamic process ..." (p. 21).

Following his discovery, Lorenz decided to put his meteorological research on hold and investigate chaotic processes in greater depth. As a starting point, he developed a set of mathematical formulae which described the behaviour of convection currents in fluids. The system was so simple that its behaviour was determined by just three equations and produced as output only three changing values.

To visualise the behaviour of his system, Lorenz used each one of these values to define a location in a 3-D space. The path that results as these numbers change might be expected to do one of two things. It might lead to one position and then stop (like a football rolling down a hill into a valley) or else it might settle into a repetitive looping behaviour (just as the moon orbits the earth).

In fact, in spite of the simplicity of his system, Lorenz found that its behaviour conformed to neither of these patterns. Although its orbit marked out a distinctive shape, it never repeated itself (see Figure 1). This is another characteristic feature of chaotic systems. Unlike the football rolling down a hill or the moon orbiting the earth, they never manage to find stable states to settle into. The weather is a good example. Although every year we know that autumn and winter will be followed by spring and summer, the precise pattern of meteorological changes will never be the same from one year to the next.

Figure 1: The Lorenz Attractor.

In the forty years since Lorenz made his discoveries, chaotic processes have been found to exist in a wide variety of natural phenomena from the beating of the heart to the formation of snowflakes. Chaotic patterns have also been discovered in human related activities as seemingly incompatible as the stock market and the art of Jackson Pollock. If chaotic patterns are to be found in visual art, might they also be relevant to music?

"Turn the numbers that represent the way a swallow's wings beat directly into music. What would you hear?" (p. 24).

Natural phenomena have long been used as inspiration by composers, bird-song being perhaps the most obvious example. Mozart, for instance, kept a pet starling. His notebook records a passage of music that he had taught it to sing with the comment: ``That was beautiful.''. Furthermore, blackbirds have been recorded singing the theme which opens the rondo of Beethoven's Violin Concerto in D (Opus 61). Handel often introduced imitations of bird songs in his compositions. In the first performance of his opera Rinaldo, a number of sparrows were actually let loose on the stage!

Chaos theory provides a new means of using nature as inspiration for composers. Since many natural phenomena display chaotic behaviour, we can the mathematics of these phenomena as a tool to endow computer generated music with desirable natural qualities. For example, the sensitivity of these systems allows them to generate a wide range of different compositions depending on the initial conditions. Furthermore, their instability means that while they can produce distinctive musical patterns, these patterns will never repeat themselves exactly.

As well as providing inspiration for composers, might it not be that there actually is a form of music inherent in the dynamics of natural processes? This view dates from Pythagoras and Plato who believed that the universe sings and was constructed according to the laws of musical harmony. Hundreds of years later, the German astronomer Kepler corrected the Pythagorean description of planetary motion. However, he inherited the belief in universal harmony and calculated six new melodies based on the orbits of the planets known at the time.

Kepler's melodies, however, were very simple. Chaos theory provides the necessary tools for a deeper understanding of the complexity of natural processes. It underlies the ability of nature to produce a wide range of visually striking patterns from snowflakes to coastlines, the patterns on a leaf to the great red spot on Jupiter. Would we be able to hear equally striking patterns if the structure of a naturally occurring chaotic process were translated into music? Or to go a step further, is there a form of music implicit in the chaotic structure of natural processes?

To investigate the answers to these questions, I have developed a computer program which generates music using a set of chaotic equations. Rather than using the data from a naturally occurring process (such as the beating of a sparrow's wings), I took Lorenz's simple model of convection currents as the source for this experiment.

"You see, any aspect of a piece of music can be represented as a sequence or pattern of numbers ..." (p. 24).

The question is not so much whether music can be represented as a sequence of numbers, as how the numbers representing a natural process can be translated into a musically meaningful pattern of numbers. To understand how this is possible, it is helpful to look at the visual representation of the Lorenz attractor. Each of the three values output by the system corresponds to a different spatial dimension (up/down, left/right, forwards/backwards). As these values change, an orbit is traced out in a 3-D space (see Figure 1).

Figure 2: The Lorenz Attractor in a 3-D Musical Space.

Can a similar process be used in the case of music? I used each value output by the Lorenz system to describe the pitch, duration and loudness of a musical note. Therefore, the orbit of the Lorenz attractor moves through a 3-D musical space similar to the 3-D visual space (see Figure 2). These are only the most obvious musical features that might be used. There are a whole host of others (some more subtle than others) which could be put to good use with more complex chaotic systems.

"The result was a short burst of the most hideous cacophony, and he stopped it." (p. 82).

As we have seen, one feature of chaotic processes is that their behaviour exhibits striking patterns which, nonetheless, never quite repeat themselves. This non-repetitive structure can be seen very clearly in the picture of the Lorenz attractor. The orbit spirals around one of two points in ever widening circles. When it reaches a certain distance from that point it spins off and spirals around the other point. Interestingly, the same kind of structure can be heard in the pieces generated by the system:

Composition 1

Composition 2

"And as for the proposed module for converting incoming Dow Jones stock-market information into MIDI data in real time, he'd only meant that as a joke ..." (p. 56).

Chaotic systems are attractive tools for algorithmic composition. This is partly because of the way in which they are able to describe change in natural phenomena. My system uses a simple artificial model of a natural process to generate music. Using real-world data (such as stock market prices) to generate music will present considerable additional challenges. In particular, the data will need to be carefully analysed in order to reveal the underlying dynamic structure of the process. Nonetheless, the prospect of hearing music in nature's patterns remains an intriguing possibility.


Douglas Adams. Dirk Gently's Holistic Detective Agency. London: Pan Books Ltd. 1988. ISBN: 0 330 30162 4.