nature, music, and algorithmic composition jeremy … · nature, music, and algorithmic composition...

12
Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch Computer Music Journal, Vol. 19, No. 2. (Summer, 1995), pp. 23-33. Stable URL: http://links.jstor.org/sici?sici=0148-9267%28199522%2919%3A2%3C23%3ANMAAC%3E2.0.CO%3B2-N Computer Music Journal is currently published by The MIT Press. Your use of the JSTOR archive indicates your acceptance of JSTOR's Terms and Conditions of Use, available at http://www.jstor.org/about/terms.html. JSTOR's Terms and Conditions of Use provides, in part, that unless you have obtained prior permission, you may not download an entire issue of a journal or multiple copies of articles, and you may use content in the JSTOR archive only for your personal, non-commercial use. Please contact the publisher regarding any further use of this work. Publisher contact information may be obtained at http://www.jstor.org/journals/mitpress.html. Each copy of any part of a JSTOR transmission must contain the same copyright notice that appears on the screen or printed page of such transmission. The JSTOR Archive is a trusted digital repository providing for long-term preservation and access to leading academic journals and scholarly literature from around the world. The Archive is supported by libraries, scholarly societies, publishers, and foundations. It is an initiative of JSTOR, a not-for-profit organization with a mission to help the scholarly community take advantage of advances in technology. For more information regarding JSTOR, please contact [email protected]. http://www.jstor.org Fri Oct 26 10:54:24 2007

Upload: lamngoc

Post on 19-May-2018

221 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

Nature, Music, and Algorithmic Composition

Jeremy Leach; John Fitch

Computer Music Journal, Vol. 19, No. 2. (Summer, 1995), pp. 23-33.

Stable URL:

http://links.jstor.org/sici?sici=0148-9267%28199522%2919%3A2%3C23%3ANMAAC%3E2.0.CO%3B2-N

Computer Music Journal is currently published by The MIT Press.

Your use of the JSTOR archive indicates your acceptance of JSTOR's Terms and Conditions of Use, available athttp://www.jstor.org/about/terms.html. JSTOR's Terms and Conditions of Use provides, in part, that unless you have obtainedprior permission, you may not download an entire issue of a journal or multiple copies of articles, and you may use content inthe JSTOR archive only for your personal, non-commercial use.

Please contact the publisher regarding any further use of this work. Publisher contact information may be obtained athttp://www.jstor.org/journals/mitpress.html.

Each copy of any part of a JSTOR transmission must contain the same copyright notice that appears on the screen or printedpage of such transmission.

The JSTOR Archive is a trusted digital repository providing for long-term preservation and access to leading academicjournals and scholarly literature from around the world. The Archive is supported by libraries, scholarly societies, publishers,and foundations. It is an initiative of JSTOR, a not-for-profit organization with a mission to help the scholarly community takeadvantage of advances in technology. For more information regarding JSTOR, please contact [email protected].

http://www.jstor.orgFri Oct 26 10:54:24 2007

Page 2: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

Jeremy Leach and John Fitch Nature, Music, and School of Mathematical Sciences University of Bath Algorithmic Composition Bath, UK BA2 7AY (jll,jpff]Qmaths.bath.ac.uk

Music has always resisted the attempts of scien- tists, analysts, and philosophers to define and un- derstand it. However, the increasing power of modern-day computers offers new possibilities for mechanization. Ideas can be quickly implemented and used to create large structures. As a result, there has been a renewed interest in the idea of a com- puter that can use simple algorithms to automati- cally compose new pieces of music. The main theory in this article, which allows existing works to be analyzed in terms of tree structures, is remi- niscent of the work by Fred Lerdahl and Ray Jackendoff (1983). However, we arrive at our "event" tree notion from a different fundamental stance. This theory, along with other new theories and methods in the analysis of music, are outlined in this article and embodied in an experimental software system for melody generation, XComposer.

Previous attempts at musical analysis (Bent and Drabkin 1987) have often used tonal music as a base, making the resulting techniques inapplicable to other types of music. Such a technique was de- veloped by Heinrich Schenker, who held that most musical works have a fundamental tonal structure embracing the whole composition. The Schenkerian technique reduces an original work to successive scores, each with fewer and fewer notes. Progres- sion from one score to another involves grouping notes together and replacing each group by a single note. The final score, termed the background, con- tains one note that represents the work's fundamen- tal tonal structure. Other analytic techniques include Roudolph Reti's "Thematic Process," which tries to identify recurring non-rhythmic themes within a piece, and Hans Keller's "Functional Analysis," which sees music as a constant battle be- tween repeated themes and new information.

All these forms of analysis could be used in re- verse to synthesize certain elements of music.

Computer Music Journal, 19:2, pp. 23-33, Summer 1995 0 1995 Massachusetts Institute of Technology.

However, the analysis techniques lack generality, objectivity, and the ability to account for all the constructs that occur in music. (For example, how are themes combined? Is i t just a random process, or does it involve some kind of talent?) We believe that these problems will always exist in any analy- sis method that does not view music as something simple and fundamental.

A critical look at some of the more obvious properties of music show what any analysis/resyn- thesis method should take into account.

Global Properties

Repetition of Note Sequences

All music contains some degree of repetition. Fur- ther examination of pieces of music shows that this repetition happens at different scales. Con- sider the melody in the first few bars of Mozart's Symphony no. 40 in G minor, shown in Figure 1.

Here we can see, in the first bar, a group of three notes, repeated three times in succession. The tenth note in the piece, B-flat, appears to be quite different from the previous nine notes, and so rep- resents a new piece of information. After the tenth note, we find that something interesting happens. Again there are three groups of three notes, with the same rhythm as the previous three. However, this time there is a change in the pitch when we move from group to group. Also, within the scale of G minor, each group of three notes which ap- pears after the tenth note does not have exactly the same form as any of the groups of three notes before the tenth note. Examining the subsequent bars, we find that these "two groups of three groups" repeat in their entirety, but at a different pitch.

We have here a hierarchical grouping of notes into bigger and bigger packages. Figure 2 shows this as a tree structure. These groupings are identi- fied by similarity and consecutiveness.

Leach and Fitch 23

Page 3: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

Figure 1. W .A. Mozart's Figure 2. Simple tree Symphonyno. 40 in G mi- structure of W.A. nor. Mozart's Symphony no.

40 in G minor.

Pitch Movement Between Groups

It is well known that it is not the actual notes in a piece of music that distinguish it, but instead the intervals, that is, the differences in pitch as the music moves from note to note. This can easily be seen by transposing the piece-multiplying the frequencies of all the notes in a piece by an arbi- trary value, x ,and playing it again to someone who is familiar with the original piece. They will of course recognize it, and if x is near enough to 1, then they may not even notice that the piece has been changed.

This has profound implications when we relate this notion to groups of notes. If we repeat a se- quence of notes, then we repeat the relationships between their pitches, even if the repeated se- quence is itself transposed to a higher pitch. This of course applies equally anywhere in the hierar- chy-if several identical groups of notes are related by certain pitch relationships, and we were to re- peat this sequence of groups at a different starting pitch, we would still keep the same pitch relation- ships between the groups. It can clearly be seen that there is a certain amount of redundancy in music when dealing with pitch change between notes. Some groups will be identical copies of oth- ers, and therefore only the change in pitch be- tween the copied group and its precedent group gives new information. So as a general rule, we should not only record the changes in pitch be- tween notes within a group, but also record the changes in pitch between groups at all levels in the hierarchy.

However we have a problem with some groups. Consider when two groups are not identical, and we try to record the difference between the two. By definition, a group contains more than one note; so how do we decide which two notes (one

from each group) we should use to determine the difference? Clearly this is not a problem with groups that repeat, as the displacement will be the same no matter which two corresponding ele- ments are investigated. Also note that non-identi- cal groups may not even have the same number of elements. One way to solve this problem would be to take the first element from both groups, and base the difference on these. However, a more natural way can be found by considering the no- tion of an event.

The Event

Music has often been likened to nature, or said to imitate how the world changes with time (Pietgen and Saupe 1988). This theory has been made more likely by recent evidence obtained from research into fractal forms, as well as time series with fractal distributions. It has been shown statisti- cally that most widely acclaimed music has a very similar distribution to fractals that have what is called a llf or "inverse frequency" distribution (Voss and Clarke 1975). By relating other proper- ties of music to natural processes, one can arrive at the notion that we call an event.

Let us take, for example, a stone falling off the top of a cliff. We observe that its behavior can be split into two parts: the behavior before it hits the bottom, and the behavior after. If, as observers, we watch its motion, we notice that as the stone ap- proaches its destination we become more and more tense. When it hits the bottom, our tension reaches its maximum; tension then decreases dur- ing the "after" period, while the stone comes to rest. Assume also that before the stone starts to

Computer Music Journal 24

Page 4: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

Figure 3. Symphonyno. 40 in G minor, repre- sented as an event tree.

fall, we are completely impartial to its existence, and that its impact has no catastrophic result, so we are equally impartial after.

If we classify the impact as an abstract entity called an event, we can say at least two fundamen- tal things about it:

1. Our tension increases because we can see the outcome of the motion, that is, we know that the event will occur in time, because we ' I 1can see the processes leading up to it. Islor event of

Halor event af Ha~orevert ofX~.l*'i event of llmoortsnee.. ,,% . 0, rnpJrtsnce 3 Impcreance 5import*oce 3 a rrrporrancs 4

2. Our tension becomes normal when there is malor event.

no more motion or energy left in the result of the event.

Other physical instances of this abstract type, the event, can be seen everywhere in nature (ani- mals chasing prey, winds increasing in a storm, waves on the shore, etc.) as well as in human in- teractions-in fact, everywhere there is anticipa- tion of something about to happen. From all of this, we see that events are something fundamen- tal in nature, and as living organisms, people have emotional reactions to them.

Of course, there are many ways in which events can interact. Consider again the stone, this time falling down a mountainside. Instead of just free- falling until it hits the bottom, it is bouncing down, because the side of the mountain is not ver- tical. Consider each impact on the mountainside to be an event. This sequence of events leads to a more dramatic event when the stone hits the bot- tom of the mountain and subsequently comes to rest. Thus we have a series of sub-events leading to a major event. Clearly we could imagine other examples where sub-events occur mostly after the event, or both before and after.

The Event in Music

The relevance of the event in music should be im- mediately apparent. Each note can be thought of as an event, with sequences of notes leading to a "ma- jor note" that represents the sequence climax. This can then be followed by another sequence. This motion can also be seen in terms of energy flow.

The kinetic energy builds up, and with each event a little is lost to the environment (resulting in an au- dible note). On the final impact, most of the energy is dissipated into the environment, and whatever is left drives the following sequence until all energy is lost. This corresponds to the popular view of music as a flow of energy or even as a flow of emotion (as was discussed earlier). By analogy with the ex- amples so far, we note that the flow of energy is in- ternal to the music itself, and the flow of emotion is the listener's reaction to the music.

We can now see that this solves the problem stated above. In every sequence of notes there must now be a note that is classified as the major event of the sequence. So, to identify the pitch difference between two groups of notes we simply take the pitch difference between the two major events.

We can now replace the previous tree structure used to represent part of Mozart's 40th symphony by one that incorporates our event theory. Figure 3 shows this representation.

This theoretically gives our music a sense of di- rection as well. To identify major notes within a se- quence, we look for changes in rhythm and melody. This contrasts with the approach of Lerdahl and Jackendoff where a note's claim to be of structural importance is decided by a set of rules (Jackendoff and Lerdahl 1982). Among these, the two most im- portant look for strong metrical position and har- monic consonance. We believe that looking for change is a more general approach that can be ap- plied to all properties in music, rather than just choosing special values in properties such as

Leach and Fitch

Page 5: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

Figure 4. A possible rhythm list. The numbers represent possible time in- tervals between events.

rhythm and harmony upon which to base a judg- ment. The reason for this is explained below.

Rhythm

What makes good rhythm? To take the simplest possible case, we should have a sequence of notes spaced approximately equally in time (although sometimes a more natural effect can be achieved if the beats in a rhythm are not exactly in time). However, the most cursory analysis of any musi- cal work that exhibits mastery will show that rhythm changes. In fact it changes from note to note in much the same way as pitch changes. Groups of notes that contain the same pattern of pitch motion usually contain the same rhythmic motion. So how is the change in rhythm deter- mined? Going back to our notion of the event, we can see that the motion of an entity changes when the event happens. Before the event, we have a fairly uniform rate of change of velocity (it could be 0, in which case the velocity is constant). At the event, the velocity of motion is changed dra- matically, and the rate of change is affected as well. Putting this into a musical context, we can see that the rhythm changes at the point of the major event. The sequence of events before the major event should arrive at a uniform velocity (i.e., a uniform rhythm), or change uniformly. The sequence of events after should follow a different rhythm which is again either constant, or changes at a rate different from that before the event.

What constraints govern the change in rhythm? We cannot just change the rhythm so that notes after the major note arrive at any randomly deter-

Figure 5. Note that there is no following sub-se- quence after the first ma- jor event. The next note is, in fact, the beginning of the next sequence.

2 units 5 units

We see that the rhythmic interval goes from 2 to 5. Neither is a multiple of the other.

mined constant rate. Instead, what we find by ana- lyzing most works is that the rhythm changes by an integer multiple. Indeed we can express these changes in a rhythm list, a simple example of which is shown in Figure 4.

This is to be interpreted in the sense that when the rhythm changes, the time interval changes from one element in the list to another. In this way the change interval is either an integer multi- plication or an integer division (in Figure 4, a change of interval from 24 to 6 represents an inte- ger division by 4).

We must note that this integer change is only applicable to rhythmic intervals which form sub- sequences on either side of a major event, as illus- trated in Figure 5.

Note that none of the branches or nodes may overlap. So if we construct an event tree that has more than a few levels, we will find that to avoid overlapping, we must use large intervals between events that are high up in the tree. If the tree has enough levels, we may find that the minimum in- terval value for two high-level events exceeds the largest interval in the rhythm list. The easiest so-

Computer Music 1ournal

Page 6: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

lution would be to continue adding interval mul- tiples to the rhythm list as needed, until the tree has been created.

There is another solution though, and to see it we must again go back to nature.

Limits of Aural Memory

Due to the recent interest that has come from re- search into fractals, there seems to be a belief that infinitely detailed, mathematically generated fractals occur everywhere in nature. Some of this has come from the "coastline analogy," where the length of a coastline is said to be infinite. We are told that if we zoom in on a coastline segment, the magnified part looks just as uneven as the original. Unfortunately this simply isn't always true. The reality is that forms in nature mimic "infinite fractals" within certain scale limits. Certainly, if we take a coastline in a 1 x 1-km square, and an- other in a 1 x 1-m square, perhaps they will look similar, and have a nearly equal fractal dimension, but the law breaks down at the molecular level. At the other extreme, if we take a 10,000,000-km square, the Earth becomes a dot-and so does our coastline. Again, we can see that this is the case with most fractal forms in nature. Mountainsides within a certain scale range resemble each other, but if we look at the Earth from a spacecraft, we perceive mountain ranges as nothing more than a slightly rough coating to the Earth. This itself is not perhaps exactly as expected, for we might have thought that mountains viewed from a spacecraft would appear like large fractal spikes projecting off the surface, giving Earth the appearance of a rock rather than a fairly smooth sphere; this is demon- strated in Figure 6. This suggests that the fractal dimension of some forms breaks down at some scale before we reach the limits governed either by their material structure, or by constraints given by objects to which they are attached.

These ideas apply to an event tree structure in similar ways. If the height of the tree is large enough, the tree structure under one event will in- deed look much the same as the structure under its sub-nodes. Also, examining the leaves gives us

Figure 6. The limits im-posed gradually over natural forms.

The Natural world as The artificial world we know it. The scale of total scale invariance. invariance breaks Invariance continues until down long before the the Earth's size and shape Earth imposes limits starts to restrict the on its shape. amount of space it can

take up.

one scale limit, and if we take imaginary levels ex- tending past the height of the tree we obtain the other scale limit. However, there is also a more subtle implication posed by the breakdown of a form's behavior above a certain intermediate scale. To see this, note that for every event in the tree that can be considered a major event, the sub-se- quence of events before should be at a constant rhythm (i.e., have constant spacing of time inter- vals). The same goes for the sub-sequence after. This is because the listener would otherwise pick up that the sequence is out of rhythm. Could it be that this regularity in fact breaks down at higher levels, before we reach the root of the tree? Experi- mental and analytical evidence suggests that this is the case. If we have a large time interval high up in the tree structure, say 16 sec, with everything else going on, would the listener really notice if

Leach and Fitch 27

Page 7: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

Figure 7. A scale tree based o n tonal scales.

Chromatic Scale

C sMajor

( ( 101011010101 )) . . . . . B major

Tonic cho ominant chord

Tonic Fourth Fifth

the next major event occurred at say 12 or 14 sec? Probably not. For Mozart's 40th symphony, we may identify the hierarchy of major events to form a tree structure, and, after about the fourth level up from the leaves; but beyond that we are unable to form sequences of events that have constant rhythm. It seems that perhaps we have identified an "aural memory limit," where the brain cannot determine rhythmic regularity beyond a certain size of time interval. Therefore, when we compose music, we need not concern ourselves with rhyth- mic regularity over certain time-spans. That is to say, at low levels (short time-spans), the rhythm should be strong, but at much higher levels it is less important, and can be very irregular.

This suggests how we can solve our problem with the rhythm list. We continue creating the list until the maximum interval surpasses some maxi- mum limit, determined by the tempo at which the music will be played. Then, while creating the tree, if we find that we must create an interval greater than this maximum, we choose the nearest interval that is a multiple of the maximum interval. The multiple is chosen so that none of the sub-branches overlap. We need not concern ourselves with whether this calculated interval is the same as the previous interval in the sequence of events.

Melody

Here we will show how to achieve a sense of mo- tion with the use of chords to create tension and resolution, and how other scales can be used in

general. We introduce the notion of a scale tree. A scale tree has a basic scale for the root. A basic scale is a division of the octave into n parts. Al- though n is quite arbitrary, for Western tonal mu- sic n is always equal to 12, and hence the basic scale is the chromatic scale. It is seen as an or- dered set of n elements that are either 0 or 1, where 0 means that the element is missing from a scale and 1 means that it is present. By definition, the basic scale is represented by an ordered set of n 1s. Branches from this root lead to sub-scales.

Defining Sub-scale

If y is a sub-scale of x, then the number of 1s that occur in y is less than or equal to the number of 1s that occur in x.

Again, each of the sub-scales can themselves have child sub-scales. The number of sub-scales that any scale can have is limited by the number of 1s that it contains. A quick calculation will show that if a scale has n Is, then the maximum number of allowable scales is 2"-1 (the scale where all elements are 0 is not allowable). Thus a typical scale tree might be as in Figure 7.

This notion is useful, because we can use it to describe a range of scales and how they interact hi- erarchically. For instance, all the major and minor scales are sub-scales of the basic chromatic scale; for example C major is the set (1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1). We then notice that the primary chord, dominant chord, and subdominant chord are sub- scales of C major. The tonic note is a sub-scale of the primary chord.

Returning to our event tree, if we consider that each note can be defined to lie within a particular scale, we can see how this could be useful. For each leaf note, we remark whether its position rep- resents a major note, and how important it is (this can be evaluated by going up the tree level by level from the leaf note until it is no longer a major event at the corresponding level). We can then as- sign to this importance a depth in the scale tree. So for a note that is not a major event at all, i.e., an importance factor of 0, we might use the root basic scale. For a note that is a major event on

Computer Music lournal 28

Page 8: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

Figure 8. Melody changes for one level.

level 1, we give it an importance of 1, and there- fore we might use a sub-scale of the root basic scale. An example might be where the chromatic scale is assigned to the notes of least importance in a sequence, the major scale is assigned to the major note in that sequence and the tonic chord "scale" is assigned to the most major of a se- quence of major notes. Again for a note that is a major event on level 2, we might use a sub-scale of a sub-scale of the root basic scale.

Once certain scales have been assigned to each of the note leaves in the event tree, we can then decide on the actual pitch to be chosen for each of these notes.

Like rhythm, the behavior of the melody also changes when a major note is reached. We imagine that the melody is moving at a constant rate. So, in a sequence of notes the pitch increases or de- creases by some constant pitch interval as we move from one note to the next. Then, when we reach the major note in the sequence we change the constant pitch interval to another value. In this case "constant pitch interval" is defined to be the number of notes, positive or negative, that the melody changes by within a pre-defined scale. We now must consider the scales that we have at- tached to these notes. Clearly the major note will have a larger importance factor than the sequence before and after it. Thus the scale that is attached to the major event should be a sub-scale of the scale used for the sequence before and after. Given a reference pitch for the major note, we can now calculate the pitches for the notes in the sequence before it and for the notes in the sequence after it. We take the example where the scale used for the sequences is C major, and the scale for the major note is the tonic, which is a subset of C major. The resulting melodic curve, shown in Figure 8, starts off in one direction, using notes of C major, then resolves at the tonic, and finally falls off in another direction.

To extend this idea to the whole tree, we apply the same process recursively from the root, to each node that is not a leaf event. In other words, we take the current event (some non-leaf node in the tree), and establish a pitch change for the sequence before and a pitch change for the sequence after.

Tonic

I ,

P i t c h change = -2 P i t c h change = -1

We then calculate and assign the resulting pitches in the sequences by adding the appropriate mul- tiple, determined by the note's distance from the major note, of the appropriate pitch change to the pitch of the major note. These pitches would be in keeping with their scales, effectively determined by their height in the tree. The major note keeps, by default, the same pitch as that of its parent. We then recursively calculate the pitches for the sub- sequences before and after each note in the current two sequences.

Much the same principle can be applied to the loudness of notes, with the only difference being that we deal not with pitches in a scale, but sim- ply with real values within a global range, 0 to 1 for example.

Mechanical Methods of Construction

The XComposer software makes use of ideas from fractals and chaos, particularly the latter. We start by considering fractals.

Fractals

The llf fractals have a particular spectral distribu- tion and can be used to create melodies that are pleasing to the ear. This is because they imitate the kind of variation from note to note that is found in accomplished music (Pietgen and Saupe 1988). The problem, however, is that methods to create l l f fractals entail the use of random data. As

Leach and Fitch 29

Page 9: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

Figure 9. The peak.

a result, in l / ffractal music, we find no repetition of themes in the pitch, rhythm, or loudness of the notes. This does not immediately invalidate the use of fractals, as there are ways to get around this problem. We can, for example, extract certain sets of values from a created fractal, and use them without strongly affecting its subtle distribution. We might then repeat some of these sets of values to create some repetition, then extract other sets when we need more new information to create va- riety in the music.

Fractals are used in the software to help obtain a pleasing variation in melodies (Dodge 1988). How- ever, another method has to be found to generate the repetition in the music. This is where chaos becomes invaluable.

Chaos

Chaos is the word used to describe some of the be- havior of non-linear dynamic systems when iter- ated. These systems are modeled as systems of mathematical equations, and a large number of systems in nature behave in a similar way. These equations are iterated such that their solution (which is a point in n-dimensional space) is fed back into the equations to become the input value for the next iteration. The sequence of points pro- duced in this manner can be called an orbit of the system. The orbit will consist of an ordered se- quence of points in an n-dimensional space. The long-term behavior of the orbit depends largely on the initial conditions and parameters of the dy- namic system being used.

This behavior falls into three categories: constant (where all points in the orbit are identical), oscilla- tory (where the orbit consists of a repeating set of k distinct points), and chaotic (where no point in the sequence is a repeat of a previous point).

The most interesting category of the three is the chaotic. It does not behave like a randomly chang- ing value. On the contrary, because each iterated point is the result of a precise formula containing no random elements, the result is a highly struc- tured orbit that has elements of near repetition within it everywhere. It is this near repetition that

is so valuable for the generation of music, poten- tially yielding themes that almost repeat but in- stead are followed by new themes, which gives the listener short-term predictability yet long-term unpredictability. This long-term unpredictability is well known in chaos. Chaos has been discovered in a wide range of natural phenomena such as the weather, population cycles of animals, and biologi- cal systems such as rates of heartbeat (Gleick 1987).

Given everything shown so far, and the axiom that music mimics the way nature behaves, it would seem natural to suggest that these non-lin- ear dynamic systems should play a large part in de- termining the actual instance of our event tree structure, i.e., the repetition, variation, and global structure of our piece of music. Their use in auto- matic composition has already provoked interest (Bidlack 1992).

So how do we use the orbit of a non-linear dy- namic system to create our event structure? We wish to find a mapping that will transform a cha- otic sequence into an event tree in a useful man- ner. To do this we must decide what features in an orbit we would like the listener to perceive. We will restrict our attention to the real values ob- tained from examining one of the n-dimensions of our system.

Clearly, as a non-linear system produces a se- quence of values, we would like each value in the sequence to correspond to a unique note in the melody, and the notes to be ordered in time as the values in the sequence are ordered with respect to the systems iteration. Also, when a value is large, we would like to see a corresponding major event. The larger the value, the more important the event

Computer Music Journal 30

Page 10: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

Figure 10. The sequence Figure 11. A n event tree of ascending peaks. with i ts corresponding se-

quence.

should be. If a value is the largest of all the values that we have considered, the corresponding event should be directly under the root of the tree. Lastly, if the behavior of the system is cyclic, we would like the structure to reflect this in some way. That is, if no new information can be ob- tained after the second iteration (it repeats with a period of 2))then the tree structure should contain no more than two notes (Field and Golbitsky 1992).

There exists a very natural mapping from an or- bit to a tree structure that satisfies these desires. The way to achieve it is to analyze the orbit of our one-dimensional real value, looking for monotoni- cally increasing or decreasing sub-sequences. To show how this would work, we shall consider some simple examples of orbits. Figures 9 and 10 show an example.

Therefore, we would like an algorithm that would map all the peaks or positive-turning points to major events. To create all the levels of the tree, we need to make this algorithm recursive, so that we make a sequence from all the resulting major events, and find the peaks in this sequence. This will give us the major events on the next level. This is shown in Figure 11.

In effect, at the expense of the individual values taken from the orbit in question, we are making a direct translation of a sample of the orbit's struc- ture into an event tree. Therefore, any sections that nearly repeat in the original orbit will be seen as repeating parts in the event tree.

Given that any dynamic orbit can now be trans- lated into an appropriate musical structure, we should ask ourselves if we are creating the right orbits. We have said earlier that the long-term be- havior of the system depends upon the value of

certain parameters. Therefore, assuming we fix these parameters beforehand, the behavior of the system will not change. This means that after a certain number of iterations, its long-term behav- ior will be predictable, even if the actual values will not. Is this a problem? To find out, we should remind ourselves that these systems are, in gen- eral, models of certain processes that occur in na- ture. The parameters that determine the behavior in the models usually correspond to an energy level present in the natural systems. However, in nature we may see all the behavior over a period of time. This is because the energy level of a system could be affected by the behavior of another dy- namic system. To show this, take the example of an animal population. A dynamic system that models a species' change in population is called lo- gistic mapping. This mapping has a parameter E, which determines the long-term behavior of the species population, i.e., whether it is constant, whether it cycles over a period of n years, or whether it changes chaotically year by year. In the real world, this parameter relates to a growth rate for the species. However, the growth rate of a spe- cies is rarely a constant value year by year. In fact, in most circumstances it would change depending on long-term changes in climate and vegetation. Therefore, a system that exhibits only one type of behavior is not representative of how the world changes in time.

Leach and Fitch

Page 11: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

So how should we vary the energy parameter during iteration? In our above example we can imagine that climatic and vegetal changes would most probably change according to other non-lin- ear dynamic systems. Indeed the "Lorenz attractor" is a non-linear dynamic system that was developed to model changes in the weather. Thus the most natural thing would be to use the output of one system to determine the energy parameter of another. In this way we can produce an orbit with the potential to exhibit all the behavior that can result from a system. Furthermore, we can produce a chain of interacting non-linear dynamic systems. We can then use the resulting orbit of the last system in the chain to drive the creation of the event structure. The XComposer software does exactly this by allowing users to design their own chain of systems.

Considering the way that everything is interac- tive in the world around us, it would seem that any single system on its own could never be said to be representative of nature.

The XCamposer Software

All of the above concepts and discoveries about chaos, fractals, and music have been implemented and automated in the XComposer software. XComposer runs under UNIX in an X Windows environment, and makes use of the Hewlett- Packard widget set. The user has control over the design of the non-linear dynamic systems and the rhythm list, and the way in which they are used to create a melody. The current software is only a prototype; in time, the user will have control over the choice of scale, allowing the use of unusual scales. The present version uses a default-scale tree based on the major scale, and is calibrated to use movement through chords to provide a sense of direction and resolution.

The interface itself is fairly intuitive to use. Most operations are confined to two simple win- dows-the composition control window, and the chaotic system design window. Figure 12 shows the screen layout. To compose a melody, the user must first define a set of chaotic formulas and how

Figure 12. The two main windows of XComposer.

they are to interact with one another. This is achieved by first choosing a particular instance of a formula (Lorenz, logistic, Henon, or constant) and then zooming in on its bifurcation diagram until a region of interest is found. The behavior of that chaotic formula is then constrained to lie within the visible portion of the diagram. The for- mula component must then be placed on the "in- teraction area" and connected to other formulas. In this way, a chaotic formula may have its energy level affected by the output of another formula.

Once a suitable chain of chaotic formulas has been constructed, the user can initiate the compo- sition process by means of the Compose Structure, Compose Rhythm, Compose Melody, and Com- pose Volume groups of buttons. These are located in the composition control window.

Other aspects of the composition can be con- trolled such as the time of the piece, and the ap- proximate length of the piece.

Future Work and Conclusions

In this paper we have presented the underlying ideas for algorithmic composition that are embod- ied in the XComposer software package. We ex- pect that in a future version of XComposer the use of random fractals will be removed from the pro- cess. The rationale behind this is that processes in nature produce fractal forms as a side effect of

32 Computer Music Journal

Page 12: Nature, Music, and Algorithmic Composition Jeremy … · Nature, Music, and Algorithmic Composition Jeremy Leach; John Fitch ... Music has always resisted the attempts of ... sis

their interactive behavior (growing cells in a plant result in fractal leaf forms). The same could apply to music and any method that attempts to create a piece of music. A future version should use simple interacting systems to produce the work and, as a quality check, the manner in which the melody varies with time should be examined to see that it follows the right fractal distribution. This already happens with the current version of XComposer concerning the dynamics of the melody, where the sum of all the output values of each of the indi- vidual chaotic systems is mapped directly to the loudness for each note (and rhythm, if required by the user). The theory here is that the summation of values, each of which changes at a different fre- quency, can produce a fractal variation over time. The condition on this is that the values change in- dependently of one another. This, of course, is not strictly the case with the chaotic systems that the user can design with XComposer, because the out- put of one influences the behavior of another. With dynamics this is not easily noticed by the ear, but with pitch it could result in displeasing variation.

A way of overcoming this problem is to take ad- vantage of another aspect of nature. The rules that govern how matter moves and interacts at any mo- ment depend upon the form of the matter at that moment. For example, rules governing how cells interact in a plant depend on the plant's stage in life, and even its existence. In other words, the rules are affected by and intertwined in the forms that they control. This means that the laws of na- ture are, in effect, self-modifying. We could intro- duce this concept into our melody generation by allowing modification of the formulas in the cha- otic system during the generation of the melody. This could be done with the composition of affine transformations with the chaotic formulas, the transformations being determined by the state of the event tree at any point in time. In so doing, the relationships between the different outputs of the

individual systems would vary in time, giving the appearance of independent variation.

This idea could also be used to make more pre- cise the way that chords change in music. A chord can be seen as part of the material substance of a melody, and the rules that determine the motion of the melody are constrained, such that the re- sulting motion lies within the chord. As we have seen, this motion can change the material sub- stance, hence changing the chord.

This article is a first step into an investigation of the relationship between music and natural growth. We suspect that the future of algorithmic composition lies in interactive systems, based on groups of fundamental natural processes that can be iterated to form an account of how a structure changes over time. The XComposer software em- bodies these evolving ideas, and will be made available for anyone who is interested.

References

Bent, I., with W. Drabkin. 1987. Analysis. Macmillan Press.

Bidlack, R., 1992. "Chaotic Systems as Simple (but Complex) Compositional Algorithms." Computer Music Iournal 16(3):33-47.

Dodge, C . 1988. "Profile: A Musical Fractal." Computer Music Iournal 12(3]:10-14.

Field, M., and M. Golbitsky. 1992. Symmetry i n Chaos. Oxford, UK: Oxford University Press.

Gleick, J. 1987. Chaos. New York: Sphere Books. Jackendoff, R. and Lerdahl, F. 1982. "A Grammatical

Parallel between Music and Language." in M. Clynes, ed. 1982. Music, Mind and Brain. New York: Plenum Press.

Lerdahl, F., and R. Jackendoff. 1983. A Generative Theory of Tonal Music. Cambridge, Massachusetts, USA: MIT Press.

Pietgen, H., and D. Saupe. 1988. The Science of Fractal Images. Berlin: Springer-Verlag.

Voss, R.F. and J. Clarke. 1975. "1/F Noise in Music and Speech." Nature 258: 317-318.

Leach and Fitch