Documente Academic
Documente Profesional
Documente Cultură
acceptable music). In fact, use of neural networks makes plemented in three parts of the GA. These are described
the fitness judgements even more inscrutable, since at in turn, and followed by an overview of the GA config-
least one can ask a human judge for the motivation be- uration used.
hind his or her judgements.
In the experiments described here, music- 4.1 Chromosome Representation
theoretical knowledge is used to construct a fitness func-
tion in objective and consistent logical terms, which al- Generally speaking, keys and chords are the main con-
lows us to examine the behaviour of the system more cepts in harmonisation of western tonal music. Har-
scientifically than would an IGA. The GA can then be monisation rules are expressed in terms of relationships
used to compare theories (psychological or otherwise) between triads, and between degrees of scale within a
of musical behaviour by observing the search patterns key signature (e.g., tonic-dominant, etc) but not the ab-
and results produced. In particular, it is to be emphas- solute pitch. Therefore, in this implementation, musical
ised that the encoded musical knowledge does not dir- information (e.g., pitch, interval, time, duration) is rep-
ectly constrain the search path - it merely constrains the resented after normalisation with respect to key - that
solution. So our interest focusses on what our GA can is, absolute pitch information is abstracted out. Then,
tell us about the search paths which arise from this un- pitch is expressed in terms of scale degree. To express all
constrained setup. twelve semitones, the standard five accidentals are used.
Different octaves are distinguished by an associated in-
teger. Finally, time intervals are represented as integers.
3 Existing Work on GAs in Music The representation conforms to the CHARM specifica-
tion of Wiggins et al. [16].
GAs have been used in music generation elsewhere. Ex- As noted earlier, a knowledge-rich and directly
amples include Horner and Goldberg [10] who used a meaningful representation is used in our chromosome
GA for thematic bridging; Biles [1], who used an IGA representation. This representation may be thought of
for Jazz improvisation; Jacob [11], who devised a com- as a matrix, which consists of five strings of equal, fixed
posing system using an IGA; and McIntyre [13] and length. The top four strings contain soprano (fixed), alto,
Horner and Ayers [9]. McIntyre used a GA to generate a tenor and bass parts, with the fifth describing the dura-
four part harmonisation of an input melody, focusing on tions of the chords. The user inputs the soprano inform-
Baroque harmony, while Horner and Ayers focussed on ation (assumed to be the melody); the GA will then har-
the harmonisation of chord progressions using GAs. monise the input soprano, homophonic ally, with a fur-
A main aim of our harmonisation project is to in- ther three voices in conjunction with the musical domain
vestigate the potential of a knowledge-rich GA and its knowledge encoded in its operators and fitness function.
performance in the musical domain. So our solution This approach is illustrated in Figure 1, using the
space is not artificially constrained as in McIntyre's sys- completed harmonisation for the first two bars of "0
tem (which only used a C major scale); nor is there prob- Come, All Ye Faithful"; see Figure 4 for the score rendi-
lem abstraction as in Horner and Ayres' system, (which tion of the corresponding output.
uses the GA to generate parts, given a chord progression,
which is a significantly simpler task). Our work aims chromosome length
, A
,
to harmonise input melodies with no explicit cues as to Soprano [0,0,3] [0,0,3] [1,0,3] [4,0,2]
[0,0,3] [4,0,2]
the required harmony, and does not limit itself to a spe- Alto [2,0,2] [2,0,2] [4,0,2] [1,0,2]
[2,0,2] [2,0,2]
cific key or scale; and it works at the level of individual Tenor [4,0,1] [0,0,2] [7,0,1] [1,0,1]
[4,0,1] [2,0,1]
voices, with all the extra constraints this entails. Bass [2,0,1] [4,0,1] [4,0,1] [7,0,0]
[0,0,1] [0,0,1]
Finally, for a more complete summary of GA DurationD
L_l_ _ _2 _ _ _ _ _ _ _ _2_ _ _ 2_
work in music, see Burton and Vladimirova [3].
Fig. 1. Schematic Diagram of a Four Voice Harmony
Chromosome
4 Harmonising Chorale Melodies
byGA In the figure, we can see the matrix arrangement
produced by the direct representation of time (left to
In this section, we present the results of a study on right along the structure) and vocal part and note dura-
the use of GAs in generating four-part homophonic tion (top to bottom down the structure). For the purposes
tonal harmony for user-specified melodies. The domain- of reproduction operators, we view the five horizontal
specific (i.e., musical) knowledge in this system is im- layers as inseparable.
231
4.2 Reproduction Operators omit the fifth only, except in 1st inversion; in inverted
chords, doubling of the bass is preferred; and we penal-
The following crossover and mutation operators are used
ise doubling oftones which give a strong harmonic tend-
in this implementation, described here in musical terms.
ency, such as leading notes.
The reader less familiar with musical jargon may find
In this implementation, the system does not have
solace in Taylor [15J.
enough knowledge to plan for large scale harmonic pro-
gression. The fitness function determines only the plaus-
Splice: One point crossover between two chromosomes
ible harmonic movement between two adjacent chords.
- selects a crossover point between successive notes
The fitness function prefers (in decreasing order of pref-
of the melody and corresponding chords.
erence): descending 5th movement; progression towards
Perturb: Mutate by allowing alto, tenor and bass to the tonic; retrogression; and repetition.
move up or down by one semitone or tone. The
selection of the various possible mutations is ran-
dom.
4.4 GA Configuration
In most of these experiments. exceptions being men-
Swap: Mutate by swapping two randomly picked voices
tioned explicitly here, a generational GA, in the style
between alto, tenor or bass. This gives the effect
of Davis (51, with a panmitic (unstructured) population
of changing the chord between different open and
model was used. Strings were initialised by randomly
closed positions, and of changing inversions.
picking chords containing the relevant soprano pitch. Fi-
Rechord: Mutate to a different chord type. This muta- nally, a popUlation size of at least 50 was used, with bin-
tion generates a new chord from the melody data. ary tournament selection.
A chord is built with the soprano note as root, 3rd
or 5th. Doubling (necessary for a four note chord)
can be in any position. 5 Results and Analysis
PhraseStart: Mutate the beginning of each phrase to All the output of the system was assessed by Dr. John
start with tonic root position on a down beat. Kitchen, a senior lecturer in the Faculty of Music at the
PhraseEnd: Mutate the end of each phrase to end with University of Edinburgh, according to the criteria he uses
a chord in root position. for 1st year undergraduate students' harmony. This ex-
ample scored 5 out of 10 - a clear pass. While other
examples were less successful (most earning around the
4.3 Fitness Function 30% mark), according to the assesser, this was mostly
The fitness function judges the fitness of each chromo- due to the lack of coherent large-scale musical progres-
some according to the following criteria derived directly sion - which was not evaluated in tbe fitness function,
from music theory. Within individual voices (as opposed so this is not a surprise. The system was judged by the
to between voices), we prefer stepwise progression over assesser to be better than student harmonisers at getting
large leaps, and we keep the voice within its proper the basic rules right.
range. We penalise progression to dissonant chords, and Figure 2 shows a harmonisation by OUr system of
we avoid leaps of major and minor 7ths, .:-f augmented the first eight notes of "Joy to the world". The output is
and diminished intervals, and of intervals larger than one not perfect, but it is surprisingly good given the limited,
octave. local nature of the rules built into the system.
Between voices, we apply the following criteria:
we avoid parallel unison. parallel perfect 5ths, and par-
allel octaves; we forbid progression from diminished 5th SA
to perfect 5th (though the converse is allowed); we avoid
hidden unison; we forbid crossing voices; and we forbid
hidden 5th and octave in the outer voices, when soprano
is not progressing stepWise. TB
Some experimentation was carried out with vari- Fitness profile from GA (Epiphany)
.."
>-
'ii
meters, such as crossover rate, mutation rate, and dif- D-
ferent selection schemes appear to affect the time taken
for the population to converge, and do little for the solu-
O
tion quality. This is due to the fact that it is the fitness 0
15
function which primarily defines the knowledge in the
system pertaining to what does or does not constitute a
good piece of music, while the other parameters define Generation 0 to 250 40 0
Position in a Chromosome
the search strategy.
Table 1. Probabilities and penalties used in the Fig. 3. A Typical Fitness Profile Landscape
experiments
in the musical harmonisation domain by the non-local and B Manderick, editors, Parallel Problem Solv-
nature of the harmonisation problem itself. This said, ing from Nature 2, pages 553-42, Amsterdam,
at least intuitively, GAs seem to offer an interesting ap- 1992. Elsevier Science.
proach to the study of creativity. It would appear that,
if GAs are to both improve in musical performance, and [8] G. R. Harik and D. E. Goldberg. Learning linkage.
allow us to gain insights into the compositional mind, In Foundations of Genetic Algorithms IV, pages
dealing with the issues raised here is an urgent task. We 270-85. San Mateo: Morgan Kaufmann, 1996.
end with a suggestion that it is likely that much can be [9] A. Horner and L. Ayers. Harmonisation of musical
gained in this particular problem by somehow combin- progression with genetic algorithms. In ICMC Pro-
ing a GA with a conventional rule-based system. ceedings 1995, pages 483-484. The Computer Mu-
sic Association, 1995.