Magazine Archive

Home -> Magazines -> Issues -> Articles in this issue -> View

The Secrets of Computer Composition (Part 1)

The question "can computers write music" has never been more important than it is in 1989; what is an algorithmic composition program, and will it ever replace the human composer? Ian Waugh composes himself.

Can a machine compose music and is it a genuine alternative to music composed by musicians? The first of this two-part series examines some of the rules of computer composition.

PROGRAMS WHICH "COMPOSE" music in one form or another are arguably the most fascinating kinds of music software currently being written. MCM, one of the largest distributors of this type of program, says composition software currently accounts for 14% of the company's software sales. Personally, I expect that figure will increase in 1989.

Instant Mozart

METHODS OF COMPUTER Composition are not new. One automatic composition process has been traced back as far as Mozart (although there is some controversy over whether he actually invented it). It consists of a grid of, say, 11 rows by eight columns, in which each square contains a bar of music. A composition is produced by rolling two dice and selecting the first bar from column one and the row indicated by the dice. Bar two is selected in a similar way from column two and so on. The tricky part, of course, is to write 88 bars of music which fit together in this way.

Most of you will already be aware of the commercial composition programs such as those listed at the end of this article. Such programs have begun to appear only within the last two years, and it would be easy to form the impression that computer compositions are a new phenomenon. But nothing could be further from the truth.

Experiments in computer-generated composition were being performed way back in the 1950s. One of the earliest, and most famous, examples is the Illiac Suite programmed by Lejaren Hiller and Leonard Issacson on a mainframe computer. A variety of rules were employed to produce counterpoint and four-part harmony. Markoff Chains (a sequence of events, the probability of each of which is dependent on the event preceding it) were also used.

The computer concerned produced a list of numbers which had to be translated into musical notes by hand - a far cry from the almost instantaneous results we can now achieve by connecting the computer directly to an electronic instrument. Nevertheless, many of the processes devised by early experimenters have formed the basis of modern composition programs.

In order to put the subject of computer composition into perspective it is important to realise that a lot of heavy theoretical work has been done on the subject by many academics - although the results of their work do not normally find their way into the public eye. The human composition process is incredibly complex (we'll come back to this subject next month) and although it is a simple matter to create a set of rules which will produce an innocuous series of notes, if you're hoping to produce anything as complex as a pop song (yes, they are an incredibly complex, highly stylised form of music) or a piece of classical music à la Bach, for example, you have to enter the realms of AI (Artificial Intelligence).

Although many commercial composition programs include what are called "harmonise" functions, these are extremely basic compared with a musician's harmonisation ability. A rule-based expert system has been written which can analyse and harmonise four-part chorales in the style of Bach but it involves AI and predicate calculus.

Before we look at the type of music composition programs are capable of producing, it's probably a good idea to decide what we mean by music.

What is Music?

IN ITS BROADEST sense, music can be absolutely anything from the opening of a cash till (music to a shopkeeper's ears) to the (pseudo) silence of John Cage's '4ft 33"'.

To most people, however, music probably means a "good toon" - something melodically and harmonically pleasing. It may have a melody which can be hummed or a harmonic, melodic or rhythmic content which is sufficiently recognisable to tap or nod along to, something you can latch onto and "follow" in other words.

For the sake of the present discussion, perhaps we can agree that this includes popular music in its widest sense and the majority of classical music. This is what 99 percent of the population listen to. (Devotees and practitioners of serial, minimalist, atonal, avant garde and other styles of music are not being ignored so don't go away.) As already suggested, the production of this kind of music by computer isn't easy and most of the work done in this area - and most of the composition programs available - tend to concentrate on less rigidly-structured output.

Even if we are able to program a computer to create music in a given style, there still remains the question of quality. This is probably the most difficult aspect of music to analyse successfully as personal preferences (dictated by many factors) play such an important part in music evaluation. But let's try anyway.

The Good, the Bad & the Musical

MUCH HAS BEEN written about what makes a piece of music good or interesting, but I don't believe anyone has yet produced a satisfactory definition. Most musicologists seem to agree, however, that the composer must give the listener something familiar while throwing in a few surprises along the way.

The familiarity is the style which will contain aspects of music the listener has heard before. This is the "latching on" process. Pop music, for example, grabs the listener straight away by hitting them with short, repetitive melodic and rhythmic phrases which are easy to identify and remember even after one hearing. This makes it easy to latch on to.

Even if you're hearing a piece for the first time your "ear" will be making assumptions about what's going to come next based upon what you have already heard. The surprise appears when the music does something you don't expect. It could take the form of a chord well removed from the original tonality, a variation on the melody line, a new rhythm pattern or a change in tone colour (instrumentation). These observations apply mainly to music with a discernible melody, rhythm and harmony but they may also be applicable to any type of music with a defined form and structure.

Now this is all very well, but after hearing the piece a couple of times you know what is going to come next - no more surprises - so how come it [can still surprise?] "Surprise" is not a surprise in the sense that it's something you haven't heard before but rather a contrast based on what has gone before. (There could be a connection between this and the reason people laugh at jokes they already know.) For example, if a piece which predominantly uses C, F and G chords throws in an E, that would be a surprise.

Well, so much for the theory, such as it is. As you can see, one of the fundamental problems presented by composition is trying to establish just what it is we're talking about.

Time to look at the methods employed by composition programs and see what sort of music they can produce.

The Generation Game

COMPOSITION PROGRAMS produce material in two ways: by generation and by manipulation. The generation process creates notes from scratch, manipulation involves restructuring existing material. Generation first.

Most commercial composition programs are labelled algorithmic. In this context algorithmic refers to the production of a composition in a series of steps using a system of rules. An algorithmic composition will have a structure but you will probably not be able to predict the actual notes it will contain - this is the part random numbers play in creating a composition.

Algorithmic compositions are not (necessarily) totally random compositions, however. Random numbers are used to produce source data to filter through selection procedures. Usually the user defines limits or "percentage chances" for various parameters and events and leaves it up to the program (and the computer's random number generator) to supply the fine detail.

For example, you may set the probability that a rest will occur instead of a note to a certain percentage and you may stipulate the upper and lower pitch limits for the notes. You may also specify the maximum allowable step size between notes and even offer a list of acceptable notes to choose from. Algorithmic programs may have 10, 20 or more such parameters, many of which will interact with each other.

The algorithmic methods of note generation invariably treat pitch and rhythmic value as separate entities. That is, there will be one set of parameters to determine pitch and another to determine rhythmic value. The two are mapped one onto the other to produce notes of varying pitch and duration.

This may seem a rather strange way of working to many musicians, but just to prove nothing is new, if we go back to the Middle Ages and look at the work of composers such as Machaut (c. 1300-1377) we can discover the foundation of this method of composition in isorhythms.

"Some computer operations have a foundation in traditional music composition, others are mathematical operations with no musical precedent."

The process is very simple and involves applying a rhythmic cycle to a series of pitches of a different length. For example, if we apply the rhythm series (in 6/8 time) crotchet (c), quaver (q) and dotted crotchet (d) to the pitch series ABCD we get the following series which will play 12 notes before the pattern repeats:

cA qB dC cD qA dB cC qD dA cB qC dD

The following is the same thing written in AMPLE MCL notation and is probably easier to read. The / means hold the note for an extra beat. An upper case name means you move up in pitch, a lower case name means you move down:

A/BC// D/aB// C/Da// B/CD//

Most composition programs can produce isorhythmic compositions although some are more suited to it than others. Intelligent Music's M and Hybrid Arts' Ludwig, for example, let you input note sequences and construct your own rhythmic cycles to apply to them. Dr T's Tunesmith will generate a rhythm pattern and then produce any number of pitch series to go with it.

Rhythm and Pitch

WHICH BRINGS US to an important question: which is the most important part of a melody, the rhythm or the pitch? Here are a couple of experiments to try; take the notes of a well-known tune and play them with a different rhythm. Then take the rhythm of the tune and play it using different notes.

As you probably aren't going to put MT down now and rush off to try this (but please do try it later) I'll tell you what I think you'll find - the rhythm plays a more important part in determining the character of the tune than the pitch.

Ever played the game where you tap out the rhythm of a tune and someone else has to guess what it is? Try it with the William Tell Overture - it's a giveaway. However, play a scale using the William Tell rhythm and see how many people recognise it.

If isorhythms seem an odd way to create a tune it's because we tend to think of a note as having a pitch and a rhythmic value, and to separate the two removes its musical identity within a composition. (Although there are several avant garde compositions which give the performers a series of notes and instruct them to play them with whatever durations they like.)

I'd suggest, therefore, that any program trying to produce a melodic tune in this fashion is immediately at a disadvantage. However, much serial and experimental music uses isorhythmic techniques. Algorithmic programs can be a valuable source of ideas and offer an easy way of playing very complex patterns.

Methodical Manipulations

THE SECOND METHOD of music creation used by composition programs is manipulation. This involves altering existing material rather than producing new material from lists of parameters. The manipulations may affect pitch or duration (timing) and it's interesting to note (I couldn't avoid the puns forever) that, like algorithmic programs, most manipulative operations treat pitch and duration separately, too.

In algorithmic procedures you will notice that unless you restrict a parameter so that only one result is possible the output is - obviously - going to be one of several possibilities. Some manipulation procedures (such as harmonisation and inversion) - have fixed, as opposed to random results so you may expect a more predictable, cohesive piece of music from them.

Some programs with manipulation facilities let you input your own material (M, Ludwig and Intelligent Music's Jam Factory) which, again, gives you more control over the music - initially at least. Tunesmith does not allow user input (although it can pull a file from Dr.T's KCS if it is being run from within the MPE) but it can manipulate source material which it has previously created.

The sort of manipulation processes you may find include mapping pitches onto different rhythm patterns, reflecting the pitches across a specified pitch (chromatic inversion) and playing a series backwards (retrograde - this facility is also available in many Dr T's sequencers such as MIDI Recording Studio) - try it with Bach.

There are even more exotic functions, such as exchanging pairs of adjacent notes, expanding a series of crotchets by inserting quaver-length notes from the series' diatonic scale, mixing pitches in adjacent notes to produce chords and substituting rests for notes. You can also usually apply many random operations, such as adding random harmonies and dropping notes at random.

Some operations (such as inversion) have a foundation in traditional music composition, others are mathematical operations with no musical precedent. Some will yield musically valid results, others won't.

Maths and Music

SO FAR I'VE tried to keep the discussion general and talk, where possible, in musical terms. But when you examine the functions of both algorithmic and manipulation procedures you will see that they are predominantly mathematically, rather than musically, based (we'll look at the reasons for this and the consequences of it next month). Dr Ts Fingers is an extreme case in point. It is almost completely mathematically-based and makes few musical concessions (you have to make these yourself).

Most algorithmic programs have a large number of parameters which determine the musical output and tweaking them in different ways will tend to produce different types of musical output. In order to do this by design rather than accident, the user must know what musical effect they will have on the output. It may help if you have a little musical theory behind you, although the musical novice can produce valid music by trial and error: listen to the output and tweak a few controls; if the music sounds better, tweak some more, if it sounds worse reset the last parameter and try something else.

Most composition programs come with demo files and some of these are very impressive. If you study the more tuneful ones, however, you'll find that the majority have very little random input.

If it's primarily melodic material you're after then notice that for all their parameters, algorithmic programs have no built-in musical rules to tell them, for example, that it's rather nice if the Mediant leads to the Subdominant (E goes to F in the key of C, say) and the Leading Note leads to the Tonic (B to C). Nor do they always work in terms of bars. Many programs, such as Tunesmith, Ludwig and M can be made to do this. Fingers can too but would rather not.

Some programs allow you to select a particular type of musical scale (Tunesmith has 46 options) but that alone is not enough to ensure a tuneful output although it can be useful to help create a tonal or modal harmonic centre.

Digigram's Big Band is one of the few composition programs which does have a musical approach. It processes material in terms of chord sequences, melodies, riffs and counterpoints without a mathematical function in sight. It will add a sequence of chords to a melody line or compose a melody to a given chord sequence. Left to its own devices it will compose both chords and melody.

Its composition styles, however, are fixed (and rather limited) and it tends to produce rather MOR (Middle of the Road) material. This trade off - ease of use against lack of control - means that its inability to create absolute rubbish is also an inability to create great music. However, the musical approach is certainly refreshing.

The current crop of algorithmic programs are reminiscent of the old analogue modular synthesisers. You set the controls on the front panel, press a button (cross your fingers) and see what comes out.

Next month we'll take a look at the human composition process and compare it with the methods used by composition programs.


Read the next part in this series:
Further Secrets Of Computer Composition (Part 2)

Previous Article in this issue

Hollis Research Trackman

Next article in this issue

Emotional Foundations

Music Technology - Copyright: Music Maker Publications (UK), Future Publishing.


Music Technology - Mar 1989

Donated & scanned by: Mike Gorman


Algorythmic Composition


The Secrets of Computer Composition

Part 1 (Viewing) | Part 2

Feature by Ian Waugh

Previous article in this issue:

> Hollis Research Trackman

Next article in this issue:

> Emotional Foundations

Help Support The Things You Love

mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.

If you value this resource, you can support this project - it really helps!

Donations for July 2020
Issues donated this month: 0

New issues that have been donated or scanned for us this month.

Funds donated this month: £0.00

All donations and support are gratefully appreciated - thank you.

Please Contribute to mu:zines by supplying magazines, scanning or donating funds. Thanks!

Monetary donations go towards site running costs, and the occasional coffee for me if there's anything left over!

Small Print

Terms of usePrivacy