Magazine Archive

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

Further Secrets Of Computer Composition (Part 2)

Article from Music Technology, April 1989

The second and final part of this series on computer composition examines the differences between human composers and their electronic counterparts. Ian Waugh keeps the score.

Deriving "rules" that a computer may use to compose music is the accepted way of approaching computer composition. But how does the approach of a human composer differ?

LAST MONTH WE looked into the complex and contentious issue of computer composition. In particular we looked at some of the procedures used by current commercial composition programs. In this concluding article we will look at the human composition process and see how it stacks up against its computer counterpart.

Compose Yourself

MUCH RESEARCH IS currently being done in the area of Al (Artificial Intelligence) where problems are being approached in a variety of ways. In order to program a computer to tackle a problem, researchers often look at how humans themselves perform the task. Seems reasonable, so let's look at how we write music. We'll assume that you're not Paul McCartney and writing tunes requires somewhat more effort than getting out of bed in the morning.

Unless a brilliant theme suddenly bursts into your head you probably sit at a keyboard and doodle. Let's assume you're doing just that and you begin by picking out a melody line with one finger. In many respects this is what algorithmic programs do. But how would you go about it if you didn't merely allow your finger to wander around the keyboard at random? Think about it for a moment.

You'd probably doodle on your instrument until you found a few notes which went together well. You may begin by playing notes at random but you would apply your "musical sense" to reject notes and sequences which you deemed unmusical.

You probably wouldn't play a note, insist on keeping it and then go looking for another note to follow it - and so on. Nor would you be likely to create a set of pitches and then impose a rhythm pattern on top of it - a compositional technique known as isorhythm. Both these methods are the norm for algorithmic computer programs and were discussed last month.

Phrase Work

ALSO, YOU WOULD probably think and work in phrases of two, four or eight bars, the length being determined by both the pitches and durations of the notes.

Musical phrases sound complete. They are entities in their own right and have an inherent musical coherence. Although algorithmic programs may be configured to produce notes to fill a certain number of bars, there is no guarantee that the result will be a musical phrase. More often than not it won't be. How can it if the program has no musical sensibility?

However, let's assume that both you and the computer have produced an acceptable musical phrase. When you move on to create your second phrase, you begin to apply another set of musical criteria or rules. You will probably want your second phrase to bear some relationship to the first one (even if this is not always the case at least the two phrases will share the same musical style). This can be accomplished in a number of ways.

You may decide to keep the same rhythm pattern and use a different set of notes. This reinforces the tune's rhythmic structure. If the pitches in the first phrase move upwards, you could make the pitches in the second phrase move downwards. You may repeat the pitches but transpose them up or down over a certain interval. You may pivot the pitches over a central point so, for example, if your first phrase contained the notes CDEFedc (AMPLE notation described in part one) and you pivoted it around C, the second phrase would be CbagABC.

All these operations are techniques used in traditional music composition but they are also mathematically based, and most could be applied by an algorithmic procedure.

However, you could also construct an answering phrase or alter just the last few notes or durations of the first phrase. These have no algorithmic equivalents.

You could construct a second phrase which has no obvious melodic or rhythmic similarity to phrase one but which still fits (the musical logic behind this is a lot more difficult to analyse and we won't attempt it here). The equivalent process in an algorithmic program is to simply let it create another phrase using the same parameters as the first one. Being constrained more by mathematics than musical sensibility this could result in a phrase identical to the first or, more likely, bearing no rhythmic or melodic similarity.

There are a number of songwriters' tricks which you may apply either consciously or subconsciously to turn those phrases into a complete tune. (Phrases can normally be analysed into shorter sequences of notes called motifs but that's another bag of chips altogether.)

There are two things of import to notice here, and although they've been mentioned before they are worth repeating: (1) you will generally make up the pitches and durations of the notes at the same time and (2) you will tend to work in phrases. In fact, I'd go as far as to say that we consider the phrase (or possibly the motif) as the smallest cohesive musical particle and, during composition, juggle the pitch and durations of the notes to fit the phrase concept. (This may occur on a conscious or subconscious level.)

Contrast this with algorithmic routines which produce a sequence of notes (which may or may not be a phrase) by putting together an arbitrary number of totally unrelated rhythms and pitches.

Well OK, perhaps I'm being rather hard on algorithmic programs. I don't think any claim to be able to produce a "tune" and, indeed, they are better looked upon as a source of phrases (Tunesmith's documentation describes it as a phrase generator).

There is a further problem, however, and that is picking out a good motif or phrase from a continuous string of notes. Still, if composing was so easy everyone would do it.

Harmony In

ANOTHER APPROACH TO composition is to start with a chord sequence and construct a melody over it. Paul Simon has confessed to using a technique employed by many songwriters, especially when inspiration is in short supply - that of playing along to a recording of someone else's tune. He follows the harmony and gradually introduces chord substitutions and makes changes to the melody until it's far enough removed from the recording to be called original.

The only commercial program I know of which can construct a melody from a chord sequence is Big Band. In fact, it insists on a chord sequence before it will compose a melody line (it will also harmonise any melody line you give it).

A human composer may work out a complete chord sequence and then put a melody to it. But he or she is probably more likely to play a couple of chords, find notes which fit - a phrase - and then add more chords and more notes. The melody can often influence or suggest the direction in which the chords should move.

Now we've added a third factor - harmony - to the composition process. We've left current composition programs way behind, even Big Band, as it does not create harmony and melody concurrently. Also, the programmer has kept Big Band's composition algorithms to himself and there is little scope for user interaction. If you use Big Band you will discover that it calls upon a limited set of rhythm patterns and the pitches it puts onto them are produced by a limited set of "melody rules", too.

To be fair to composition programs, the human compositional process is incredibly complex. In order for a computer to generate human-like compositions, an enormous number of factors would have to be taken into consideration. I doubt if the human composition process has been analysed sufficiently well enough for it to be converted into a computer program. Not yet at least.

Variations on a Theme

LET'S LOOK AT another aspect of composition - variations. A variation is the result of modifying a theme in such a way that the result is recognisably derived from the original. Five basic devices are used: variation of melody, of figuration or texture, of rhythm, of tonality (major for minor, for example) and of harmony. Any or all of these may be combined in the same variation.

Programs which manipulate data (as opposed to generating it) will be able to produce variations - of sorts - and Dr T's Tunesmith is actually subtitled a "Theme & Variations Generator". But is the computer's idea of a variation the same as a musician's?

Harmonic variations are commonly practised by jazz musicians who often substitute one chord for another. In as much as Big Band can put a (limited) number of different harmonies (chords) to a given melody line, it could be said to be capable of producing harmonic variations although none will shake the foundations of the jazz world.

Many tunes have a distinctive chord progression, not always the most obvious one. An extreme example is 'One Note Samba' which relies completely upon harmony for its effect. Have you ever heard a busker playing a song using simple chords (the three-chord trick) instead of the correct ones? Grates, doesn't it?

It can be quite interesting to take a melody and set it to different chords to see how well - or badly - the substitutions work. Big Band can do this but rarely will it produce a melody's original harmony except perhaps in the simplest of tunes.

Tunesmith's Accompaniment Generator can add parallel (and partial parallel and random) harmonies to a line and several other programs (including "straight" sequencers such as Comus' Studio 24) can add harmonising notes to a melody line. These harmonising routines work well at a low level (although they may throw up one or two anomalies) but they work on notes individually rather than the phrase as a whole. They are certainly not up to tackling a Bach chorale (although a rule-based expert system has been constructed which is capable of such feats - see first article).

Melodic Manipulations

MELODIC VARIATIONS ARE easier for a program to produce - you just apply a manipulation process to the music and there's a variation (we discussed many manipulation procedures in the first article). However, most routines have their basis in maths rather than music.

The most common method of manipulation is to randomly alter the note series in some way. A routine could play notes from the series at random, apply random durations to them or delete notes at random. These processes are ideal for texture music but they have no musical precedent and are not guaranteed to produce a variation in musical terms (although the variation may be recognisable under mathematical analysis).

How does a musician vary a phrase? If it's in "straight" time he can swing it or take other liberties with the timing such as squashing the notes in a phrase together or stretching them out. As rhythm tends to play a more important part in creating the character of a tune than the pitch of the notes (as discussed in the first article), this needs to be handled with care.

Other methods of variation include the omission of non-essential or "passing" notes. These will tend to be the ones which fill-in between those notes that fall on the main harmony points of the tune. You could also fit extra notes in between the melody notes or substitute melody notes with notes from the chord which is supplying the harmony at that point in the music.

Classical variations include embellishment of individual notes (trills, mordents, and so on) and phrases (with runs and arpeggios).

All of these variations require a great deal of musical awareness and are beyond the capabilities of any current composition program.

At its highest level, a variation can merely suggest the original theme rather than make a reference to it directly. (We'll skip an analysis of this, too.)

Having used several composition programs to produce music in a variety of styles, I wondered why they used such a mathematical approach rather than a musical one, particularly as I had written some, admittedly simple, music-based composition programs for the BBC micro way back in '84.

BASIC Experiments

AN EARLY PROGRAM used weighted dice rolls to produce durations, and pitches were selected from a preset pitch table. The procedure was not unlike that used by Dr T's Fingers but rather more basic and limited.

I began to develop a rule-based system with rules such as:

1) The first note must be a member of the tonic chord. In the key of C that would be C, E or G.

2) The interval between any two consecutive notes must not be more than four tones.

3) The Leading Note must go to the Tonic (so B would go to C).

4) The last bar must end on the tonic (C in the key of C) and last for a complete bar.

It produced sequences of notes (you'd hardly call them tunes) four bars long. The note durations were fixed to eighth and quarter notes except for the last note which lasted for a whole bar. In an attempt to make it more musically and rhythmically cohesive, I developed two more rules:

1) If quavers occur, there must be at least two of them consecutively.

2) A bar cannot start with a series of three quavers.

And an additional instruction:

3) Bar one must have the same duration value sequence as bar three, bar two must be the same as bar four and so on.

The program certainly produced music superior to totally random output but nothing to write home about. You'll also notice that pitch and duration were largely treated separately.

However, five years on my point is how much easier it would be for a musician to tailor the output of a composition program to his requirements if the rules and methods of operation were musical rather than mathematical. That's not to say that some mathematical rules don't produce musically interesting results. We don't have to remove mathematical rules but let's have some musical rules, too.

Note Analysis

AT THE SAME time I also devised a note analysis program. This produced interesting results, but its method of operation hasn't, as far as I am aware, been implemented in a commercial program as yet. The idea, however, was not original and a similar process was carried out on Stephen Foster songs over 25 years ago. (He wrote such standards as 'Camptown Races', 'Oh Susannah' and 'Old Folks at Home'.)

At its simplest level the program produced a frequency table of how often each note occurs in a tune. This is first order analysis. A second order analysis was done based on how often each note followed every other note. A third order analysis was also done which analysed each consecutive pair of notes and the note which followed them.

When the analysis was complete, the program would play back the notes acording to the frequencies in the first, second or third order analysis tables.

My program only analysed pitches, not durations, but there's no reason why the pitch and duration of each note could not be analysed in a similar way. The pieces I chose for analysis contained notes having mostly the same duration. Bach was a firm favourite. An interesting "game" was to start with the first order table and ask a listener if they could identify the tune. By the time it reached third order, snatches of phrases from the original tune would occur.

I can't claim that the results were as musical as the originals but I wonder what results could be obtained if you analysed melodic, rhythmic and harmonic aspects of several tunes by one of our great songwriters or composers.

My final attempt at computer composition was to write a chord-based program. The idea was trite in the extreme but it produced better tunes than the other programs - and it predated Big Band by a few years (although Big Band is infinitely more sophisticated).

Simply, you entered a chord sequence and it would play notes from the chords at random (a similar program can be found in Acornsoft's Creative Sound book). What made it so musical was the fact that it played the chords as well as the melody so the listener had a concrete harmonic base to relate to. But more importantly, it could choose from about five preset one-bar rhythms and so produced tunes in phrases, albeit of only one bar. Hardly spectacular, but Western ears are used to hearing tunes in phrases so that helped its credibility.

Calling the Tune

I'M PROBABLY STICKING my neck out here but I offer my concluding remarks as food for thought rather than as immutable facts.

The current range of algorithmic programs are highly suited to the creation of several types of music, notably that which may be described as textural, floating, serialist, minimalist and so on. Highly structured and melodic tunes, however, are not their forte although they are capable of producing phrases which can be used in them.

Why is it so difficult to produce stylised music - the "good tune" which was defined in the first article? Algorithmic programs can produce pleasant series of notes but they are not capable of ordering them into the highly structured format demanded by our "good tune". It's not because they are using the wrong approach, it's just that they are working at such a low level.

I believe this is also the reason why their functions appear so mathematical. At this level music is mathematical, but good maths do not (necessarily) good music make. The human composer has absorbed, subconsciously if you like, the mathematics behind the music and composes on a much higher level. A comparable analogy is our walking function. We think of where we want to go and our body does the rest. We don't have to consciously lift one foot, put it in front of the other, put it down, lift the other foot and so on. Nor do we have to instruct the individual muscles to contract and relax. If you accept the analogy then composition programs are just starting to find their feet.

Programs such as Intelligent Music's Jam Factory and M, and Hybrid Arts' Ludwig (reviewed in this issue) are going in the right direction but stop at the ground floor.

By allowing you to work directly with chord sequences and melody lines, Big Band would appear to be operating at a higher level. It does this because its lower levels are largely preset. It is, in a way, like the Mozart dice program (mentioned in Part 1).

Composition programs currently available in the UK

It all comes down to control, and in order to produce convincing computer-generated music you need a higher level of control such as that offered by a high-level language. This would let you manipulate the individual elements of a composition and give you control over form and structure. Current programs don't allow this. You would need to be able to design your own algorithms, too. If Big Band had programmable algorithms it would be a different program altogether.

We're entering the realm of the programmer here and it's probably fair to say that most musicians want to get on with the task of making music - they don't want to learn how to program. It's interesting to note, however, that most if not all the successes in the academic field have been produced by specially-written programs.

Interested musicians-cum-programmers may like to check out MIDI LISP for the Mac, HMSL (Hierarchical Music Specification Language) for the Amiga and LOCO, a LOGO-like music language available for the Apple lie and Mac. These are languages, however, and not plug in and go systems.

A more widely-used language worth investigating - and probably easier to learn - is AMPLE which is implemented on the BBC micro as part of the Hybrid Music System. It has already been used by composers such as Tim Souster (of Hitchhikers Guide fame) arid Patrick Gowers who used it to write some of the music for the Sherlock Holmes TV series.

Current algorithm and manipulation programs have taken their composition procedures just about as far as they can go The next stage in program development is to allow users to operate at a higher musical level. Simply giving us more varied and exotic algorithms is not going to contribute much more to what we already have.

The problems are many and the solutions will not be easy to implement, but the rewards could be enormous.

Series - "The Secrets of Computer Composition"

This is the last part in this series. The first article in this series is:

All parts in this series:

Part 1 | Part 2 (Viewing)

More from these topics

Browse by Topic:

Algorythmic Composition

Composing / Art

Previous Article in this issue

MIDI Merge Boxes

Next article in this issue

MIDIMouse Sonicflight D50/550 Capture!

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

The current copyright owner/s of this content may differ from the originally published copyright notice.
More details on copyright ownership...


Music Technology - Apr 1989


Algorythmic Composition

Composing / Art


The Secrets of Computer Composition

Part 1 | Part 2 (Viewing)

Feature by Ian Waugh

Previous article in this issue:

> MIDI Merge Boxes

Next article in this issue:

> MIDIMouse Sonicflight D50/55...

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 2024
Issues donated this month: 14

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

Funds donated this month: £20.00

All donations and support are gratefully appreciated - thank you.

Magazines Needed - Can You Help?

Do you have any of these magazine issues?

> See all issues we need

If so, and you can donate, lend or scan them to help complete our archive, please get in touch via the Contribute page - thanks!

If you're enjoying the site, please consider supporting me to help build this archive...

...with a one time Donation, or a recurring Donation of just £2 a month. It really helps - thank you!

Small Print

Terms of usePrivacy