09-11-2012, 04:23 PM
A Simple Genetic Algorithm for Music Generation by means of
Algorithmic Information Theory
A Simple Genetic Algorithm for Music Generation.pdf (Size: 146.72 KB / Downloads: 30)
INTRODUCTION
The automatic generation of musical compositions is a
long standing, multi disciplinary area of interest and research
in computer science, with over thirty years of history at its
back.
Some of the current approaches try to simulate how the
musicians play [1] or improvise [2] on the fly, while others
are not concerned with execution time and mainly try to
generate some ‘good’ output. Many of them apply models
and procedures of theoretical computer science (cellular automata
[3], parallel derivation grammars [1], or evolutionary
programming [4], [5], [6], [7]) to the generation of complex
compositions. The models are then assigned a musical meaning.
In some cases, the music may be automatically found
(composed) by means of genetic programming.
In a previous paper [8] we proposed the use of the wellknown
Normalized Compression Distance [9], an algorithmic
information measure , as a fitness function which may be
used by genetic algorithms to automatically generate music
in a given pre-defined style. The superiority of the relative
pitch envelope over other musical parameters, such as the
lengths of the notes, has been confirmed in [10], bringing us
to develop a simplified algorithm that nevertheless obtains
interesting results.
II. MUSICAL REPRESENTATION: RESTRICTIONS
Melody, rhythm and harmony are considered the three fundamental
elements in music. In the experiments performed in
this paper, we shall restrict ourselves to melody, leaving the
management of rhythm and harmony as future objectives. In
this way, we can forget about different instruments (parts and
voices) and focus on monophonic music: a single performer
executing, at most, a single note on a piano at a given point in
time. Melody consists of a series of musical sounds (notes) or
silences (rests) with different lengths and stresses, arranged
in succession in a particular rhythmic pattern, to form a
recognizable unit.
In the English notation for Western music the names of the
notes belong to the set {A, B, C, D, E, F, G}. These letters
represent musical pitches and correspond to the white keys
on the piano. The black keys on the piano are considered as
modifications of the white key notes, and are called sharp
or flat notes. From left to right, the key that follows a white
key is its sharp key, while the previous key is its flat key. To
indicate a modification, a symbol is added to the white key
name (as in A# or A+ to represent A sharp, or in Bb or B-,
which represent B flat). The distance from a note to its flat
or sharp notes is called a half step and is the smallest unit
of pitch used in the piano, where every pair of two adjacent
keys are separated by a half step, no matter their color. Two
consecutive half steps are called a whole step. Instruments
different from the piano may generate additional notes; in
fact, flat and sharp notes may not coincide; also, in different
musical traditions (such as Arab or Hindu music) additional
notes exist. However, in these experiments,
CONCLUSIONS AND FUTURE WORK
We have found that that the Normalized Compression
Distance is a promising fitness function for genetic algorithms
used in automatic music generation. Some of the
pieces of music thus generated recall the style of well-known
authors, in spite of the fact that the fitness function only takes
into account the relative pitch envelope. Qualitative response
by human audiences confirms that the results described in
this paper are superior to those obtained previously with a
different fitness function [16].
Several recombination operators have been tested to fine
tune the genetic algorithm for this application, finding that
mixed strategies which promote diversity in the first generations
and then change to a more exploitative strategy
give the best results. This scheme of initial exploration
and posterior exploitation is analogue to the idea behind
Simulated Annealing [17].
In the future we intend to combine our results with those of
other authors [10], [13] and use as the target for the genetic
algorithm, not one or two pieces of music by a given author,
but a cluster of pieces by the same author, thus trying to
capture the style in a more general way.
Our current experiments focus the search on melodies
which can be considered an average of the target pieces.