Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Martin Dostal
1 Introduction
Evolutionary techniques have attained high popularity in machine learning and optimization. These techniques have a wide body of applications including less conventional areas such as machine-based creating of (art)works. However, the term artwork may seem as overstatement, depending on your definition on what an artwork
really is, so we can use rather the term machine creativity for machine generated
paintings, music or poetry.
In this book chapter we discuss machine-based generation of music using evolutionary techniques. We assume that the reader is at least somewhat familiar with
music, not necessarily as composer of performer, but at least as a consumer. Also
some familiarity with evolutionary techniques is expected.
Martin Dostal
Dept. Computer Science, Palacky University Olomouc, 17. Listopadu 12,
77146 OLOMOUC, Czech Republic
e-mail: martin.dostal@upol.cz
I. Zelinka et al. (Eds.): Handbook of Optimization, ISRL 38, pp. 935964.
c Springer-Verlag Berlin Heidelberg 2013
springerlink.com
936
M. Dostal
937
process in a somewhat similar way to the later used evolutionary techniques. Iannis
Xenakis, a Romanian-born Greek composer, was one of the pioneers of algorithmic
composition. He used stochastic techniques in music composition and developed a
computer program that helped him in composition [53, 54].
Automatic composition of musical pieces is apparently one of the most challenging problems in machine art. In past twenty years several systems were developed
and some of them also successfully used in the composition of true musical pieces
(in contrast to experimental, or toy-like nature of some other systems) or live performances. Rodney Waschka II, an american composer known for usage of algorithmic composition methods, created a composition tool called GenDash [49, 50].
GenDash creates variations of musical motives using a genetic algorithm. Waschka
is one of composers that used his system successfully in publicly performed compositions including Saint Ambrose, Sapphos Breath (both chamber operas) [51]
or String Quartet: Ha! Fortune or Eclogues for Woodwind Quintet [50]. We descibe
GenDash in more detail in Section 3. Jacob [31, 32] also experimented with creating
variations of melodic motives using genetic algorithm. Jacobs system also considered an ear module for listening and evaluating composed melodies in contrast
to Waschkas system which omitted the fitness evaluation at all. GaMusic [39] was
a system for composing of two-octave melodies on the basis of interactive genetic
algorithm. Another attempt to evolve melodies using interactive genetic algorithm
has also been made by Ralley [40].
Johanson and Poli created the GP-Music system that evolves short melodic sequences according to both mentors preferences and autonomous measures by the
system itself [33]. GP-Music is a good example of a toy-like experimental system.
The system is based on genetic programming and we provide detailed description
of the system in Section 2.
Spector and Alpern [42, 43] proposed the GenBebop; a system for composing
short jazz improvisations, the so called trading fours. Trading fours refers to fourbar improvisations on a reply to recently played four bars by another player. However, generating bebop improvisations is only a particular application of Spector and
Alperns approach. Their aim was more general: they attempted at a system which
would enable a construction of artificial artists with some aesthetic tradition and particular musical preferences. Similar application area has also been investigated by
Biles who developed GenJam [8, 10, 11, 13]. It is one of the most referred evolutionary composition systems so far. GenJam is an interactive genetic algorithm-based
system for trading-fours improvisation. The system is, however, able to improvise
in real time, thus Biles used GenJam successfully at a lot of live performances with
938
M. Dostal
his Virtual Quintet, which is a combo of John A. Biles on trumpet or flugelhorn and
GenJam on tenor sax and other instruments. GenJam also participated on several
Biles music records with the Virtual Quintet.
Thywissen [44] introduced GeNotator, a hybrid-algorithmic composition tool for
computer assisted composition of music. Gibson and Byrne [21] designed a system for composing short musical pieces using diatonic, four-part Western harmony.
The system has been called NEUROGEN and utilized a genetic algorithm to compose music and neural networks to evaluate the quality of generated results. Unemi
[47, 48] created SBEAT, an interactive system for breeding short musical phrases
(e.g., rhythm patterns) in terms of musical patterns with various rhythm, pitch and
velocity.
A distinctive part of music composition has been investigated by Horner and
Goldberg who developed a system for thematic bridging [29]. Thematic bridging is
a process that lies in transforming one musical part into another musical part over
an interval of time.
1.2.2
Harmonization
939
harmonization and points-out that the task of harmonization is not just a matter
of filling of the notes according to the rules of harmonization but also creating a
musical structure with a musical intention behind. The latter point is, however, not
taken into account in most systems that perform harmonization. In fact, a local performing of algorithmic composition systems (e.g., typically on the current measure
only) without a broader context, such as planning a structure of the composition,
is the property of most current systems. For instance, GeneticDrummer is such a
locally performing system. It generates a phrase with rhythm accompaniment by
individual measures. During the generating process the system does not see the preceding nor following measures so that the composition process is entirely local. The
consistence of resultant phrase is, however, ensured by the application of the same
constrains (specified by the fitness function) on each measure present in the phrase.
1.2.3
Rhythm
Horowitz [30] used interactive genetic algorithm for composing short rhythm patterns. The system used also some fitness criteria (e.g., syncopation, density, downbeat, beat repetition) that were derived from the mentors evaluation. Tokui and Iba
developed a system called CONGA [48], an evolutionary drum machine that evolves
multi-timbre rhythm patterns. CONGA is an interactive system extended with a neural network which performs as an evaluation assistant. The system combines genetic
algorithms and genetic programming: individual measures are generated using genetic algorithm whereas the complete phrases are bred using genetic programming,
see Section 6 for detailed description of the system. NEAT Drummer [26] evolves
rhythm patterns using a combination of neural networks and interactive evolutionary
computation.
GeneticDrummer [1719] is one of a few evolutionary systems that perform autonomous evaluation of generated results using various fitness operators. The system
evolves a rhythm accompaniment played on a common drumset. Another difference
to the most of other existing systems is that the rhythm accompaniment is evolved
to an existing musical phrase in addition to users specified preferences. That is, the
generated accompaniment should match the musical phrase to which is the rhythm
accompaniment being generated. We describe GeneticDrummer in detail in Section 7.
940
M. Dostal
941
Interactive Systems
942
M. Dostal
Interactive systems thus typically use small populations in order to keep the
amount of evaluations admissible. Nonetheless, the task for the mentor is still
time consuming and fatiguing. Several interactive systems address this issue with
a machine-based mentor that helps the human in evaluation. These systems [14,
33, 43, 45] typically use an artificial neural network that learns from the mentors
responses and provide a preliminary evaluation or pre-filtering of results (e.g. autonomous identification of losers).
1.4.2
Autonomous Systems
943
2 GP-Music
Johanson and Poli created the GP-Music system that evolves short melodic sequences according to both the mentors preferences and autonomous measures of
the system itself [33]. GP-Music is based on genetic programming. Basically, the
system is interactive, however the automated measures can be performed using an
extended version of the system that combines genetic programming with a neural
network. The network is trained using the mentors responses and performs an autonomous evaluation of generated music afterwards.
Individuals, that is musical sequences, are represented as program trees as widely
used in genetic programming. Terminals represent individuals notes (the following
subset of chromatic scale is available: C-4 C#4 D-4 D#4 E-4 F-4 F#4 G-4 G#4 A-5
A#5 B-5), chords (C-Chord, D-Chord, E-Chord, F-Chord, G-Chord, A-Chord, BChord) or rest. Notes have a constant duration. The function set contains operations
to constitute the sequence structure:
Fig. 1 and Fig. 2 depicts an individual that represents the following sequence: [F-4
rest C-4 rest F#4 C#4 rest C D].
(PLAY-TWO
(PLAY-TWO
(ADD-SPACE (PLAY-TWO F-4 C-4))
F\#4)
(PLAY-TWO
(ADD-SPACE C\#4)
(PLAY-TWO C D)))
Fig. 1 Example of an individual in GP-Music
944
M. Dostal
Listening
Authors provide several sound examples including a description of the parameter
setting.
http://graphics.stanford.edu/bjohanso/gp-music/
gp_music-old.html
3 GenDash
GenDash [49, 50] is a compositional tool developed and used by american composer
Rodney Waschka II. The system itself is intended for composing musical pieces in
a highly collaborative way with the human composer. Waschka successfully used
GenDash to compose complete musical pieces as well as to generate parts of pieces
that were further processed and arranged into musical pieces by the author.
GenDash is rather a music composition tool for the human composer than an
autonomous music composition system. The system is intended primarily to create variations of measures of music but without the evaluation of generated musical pieces by the human mentor or a fitness measure during the evolution process.
It means that GenDash lacks one fundamental part of an evolutionary system and
suggests that it is a compositional tool which the composer uses to generate some
musical pieces that he afterwards deliberately decides to use it in a piece or discard.
The technique behind GenDash is basically a genetic algorithm without fitness
evaluation. That is, individuals to be reproduced to the next generation are selected
at random. Individuals represent measures of music. The initial population of individuals is predefined by the user. For instance, Waschka used a population of
twenty-six measures of music drawn from typical Greek and Medieval songs for
945
4 GenJam
GenJam (a short for Genetic Jammer) is a system for generating jazz melodic improvisations that has been developed by John A. Biles [8, 10, 11, 13]. The system is able
to improvise full-chorus solos and chase choruses in real time. Chasing choruses is a
standard practice in jazz improvisation where soloists improvise on four-bar phrases
on a tune in a way that a soloist chases the previously played phrase by another
soloist by developing a new four-bar phrase on the basis of the previously played
one. In GenJam, the chorus chasing is performed between a four-bar phrase played
live by the performer and GenJam which chases the performers improvisation. The
human performer plays a melody on an instrument that is converted in real-time to
corresponding MIDI events using the Roland GI-10 pitch-to-MIDI-converter. These
data are further processed by GenJam as it will be explained below.
GenJam is based on interactive genetic algorithm that breeds new melodies. Since
the system is interactive, the evaluation of generated phrases is performed by the human mentor. The mentor listens critically to generated results and provides on-going
feedback on the perceived quality by evaluating phrases as good, bad or neutral. As
it was mentioned, the system interacts with the performer and the mentor. Additionally, GenJam uses some other data required for the interactive genetic algorithm
operation:
Measure population that contains chromosomes. Each chromosome holds one
measure long melodic phrase and its fitness.
Phrase population. Chromosomes in Phrase population contains the phrase fitness and identifiers to corresponding measure chromosomes that constitute the
phrase.
946
M. Dostal
4.1 Population
GenJam uses two populations; a phrase population and a measure population.
Both populations are of fixed size: phrase population contains 48 individuals and
measure population holds 64 individuals. Individuals are encoded using bit-string
chromosomes.
947
A chromosome in phrase population encodes an identifier, fitness value and identifiers of individuals in the measure population that constitute the phrase. For example, consider a phrase chromosome depicted on Fig. 3. The chromosome has identifier 10, fitness -5 and the phrase is composed of four measure chromosomes with
the following identifiers: 20, 34, 11 and 23.
A chromosome in measure population encodes its identifier (that is used to referencing measure chromosomes in phrase chromosomes), a fitness value and onemeasure-long melodic phrase in 4/4 time. A phrase is encoded in a series of eight
events, each representing one eighth-note-length event. These events are further
transformed to MIDI events and played by the synthesizer. An event may represent
either a note, a rest or a hold. Hold event has the effect of holding the previous event.
For example, if a note event is followed by one hold event, the note will be played
with quarter-note duration. Note events encode a relative note (pitch) of the event
(see below). Since the events are internally represented as four-bit strings, GenJam
is limited to 14 note scale at one time, 2 of 16 possible combinations are reserved to
the rest and hold events. The rest event is encoded in chromosome as 0, hold as 15
and note events as 1-14. See Fig. 4 which depicts four chromosomes referenced in
the phrase chromosome from Fig. 3. Fig. 4 contains chromosomes with ids 20, 34,
11 and 23 whose fitnesses are: -3, 12, -22 and 4.
As it was stated above, note events encode relative notes while 14 different notes
are available. These relative notes are mapped using predefined scale maps and the
chord progression of the tune. Chord progression defines harmonic structure of the
tune (limited to two chords per measure at maximum). A note map is an array of
pitches representing a scale appropriate to the given chord. Since the scale may
not be composed roughly of 14 notes, the scale is extended to 14 notes using scale
948
M. Dostal
Scale
Major (avoid 4th)
Mixolydian (4th)
Minor (avoid 6th)
Locrian (2nd)
W/H Diminished
Lydian Augmented
Whole Tone
Lydian Dominant
Altered Scale
H/W Diminished
Phrygian
Lydian
Notes
CDEGAB
C D E G A Bb
C D Eb F G Bb
C Eb F Gb Ab Bb
C D Eb F F# G# A B
C D E F# G# A B
C D E F# G# A#
C D E F# G A Bb
C Db Eb E F# G# Bb
C Db Eb E F# G A Bb
C Db Eb F G A Bb
C D E F# G A B
Obviously, this kind of representation is limited in several aspects. First, it can encode only eighth-note multiplies. Second, there is not possible to encode a dynamic
articulation of notes. Third, there are only 14 pitches available at the time. Finally,
the humans playing is quantized to eighth-note-length intervals which limits the
rhythmical expressivity of the system.
The populations are initialized at random at the outset of evolution. Each chromosome has assigned a fitness value equal to zero. In measure chromosomes, the
staff part is initialized with events. Each position is initialized either with a rest, a
1
and the probability
hold or a note event. The probability of a note event is set to 24
5
of a rest or and a hold event is set to 24 . Biles set the probabilities on the basis of
empirical observations.
949
chromosomes. One of the offsprings then undergo mutation, while the other one is
kept unmodified.
Mutation is the most interesting operation of recombination operations in GenJam. It does not operate on a bit-level as many conventional, general-purpose mutation operations used in genetic algorithms, but rather at the level of individual
events. The point is to provide musically meaningful manipulation of measures encoded in chromosomes. GenJam performs mutation on both phrase and measure
chromosomes. On measure chromosomes, the following operations can be applied:
Identity. Returns identical, unmodified chromosome.
Reversion. Produces a chromosome with reverse order of events. For example,
a reversion of chromosome [20 -3 14 13 14 12 15 9 0 0] would result in [20 -3 0 0 9 15 12 14 13 14].
Right Rotation. The event-part of a chromosome is rotated by randomly chosen
number (between 1 and 7) of positions to the right. For example, a right rotation
of chromosome [20 -3 14 13 14 12 15 9 0 0] of 3 positions would
result in [20 -3 9 0 0 14 13 14 12 15].
Inversion. Each event is changed to 15-<event-value>. For example, an inversion of chromosome [20 -3 14 13 14 12 15 9 0 0] would result in
[20 -3 1 2 1 3 0 6 15 15].
Ascending Sort. Events in chromosome are sorted in ascending order. For example, ascending sort of chromosome [20 -3 14 13 14 12 15 9 0 0]
would result in [20 -3 0 0 9 12 13 14 14 15].
Descending Sort. Events in chromosome are sorted in descending order. For example, ascending sort of chromosome [20 -3 14 13 14 12 15 9 0 0]
would result in [20 -3 15 14 14 13 12 9 0 0].
Transposition. This operation is performed on a randomly selected number of
steps (between 1 and 4) on the direction of greater minimum distance between
the note-event and upper (i.e., 14) or lower (i.e., 1) bound. Hold and rest events
are unaffected. For example, a transposition of chromosome [20 -3 14 13
14 12 15 9 0 0] of 3 positions would result in [20 -3 11 10 11 9
12 6 0 0].
On phrase chromosomes the following operations can be applied:
Identity. Returns identical, unmodified chromosome.
Reversion. Produces a chromosome with reverse order of events. For example, a
reversion of chromosome [10 -5 20 34 11 23] would result in [10 -5
23 11 34 20].
Right Rotation. The event-part of a chromosome is rotated by randomly chosen
number (between 1 and 7) of positions to the right.
Genetic Repair. Replaces the reference to the worst chromosome in phrase with
randomly selected another one.
Super Phase. Generates completely new phrase. On each position a tournament
of three measure chromosomes is performed and a reference to the winning chromosome is stored at the corresponding position in phrase chromosome. Note that
this operation usually does not preserve any phrase from the parents.
950
M. Dostal
Lick Thinner. This operation replaces a reference to measure in the phrase chromosome that occurs in the phrase population most frequently. The reference is
replaced by another one selected at random. The role of the operator is to eliminate some occurrences of highly fit measures from the phrase population.
Orphan Phase. It operates opposite to the Super phase operation, that is the less
fit chromosomes are considered as winners from tournaments. This operation is
intended to increase the diversity of population.
Since GenJam is interactive system, the evaluation cannot be performed in every
generation of the breeding process. In Demo mode, only selection is performed. In
Breeding mode, all recombination operators are applied. Fitness values are assigned
interactively by the mentor in Learning mode. Biles also experimented with a different version of GenJam that eliminates the evaluation of generated results by the
mentor, see [12] for more detail. Biles and Anderson [14] have also made an attempt
to enhance the interactive evaluation by the mentor with a neural network that is able
to discover worst individuals in population. However, the experiments did not result
in much success.
Listening
The webpage contains several nice music examples including a description.
http://www.ist.rit.edu/jab/GenJam.html
951
of inversions. Both open and closed harmony are common techniques for voicing
in harmonization.
Rechord. It generates a new chord from the melody stored in the soprano voice.
A chord is constituted by the note in soprano voice as a root note, and 3rd or 5th.
PhraseStart. Mutates the beginning of each phrase to start with tonic root position on a down beat.
PhraseEnd. Mutates the end of each phrase to end with a chord in root position.
Obviously, crossover and mutation can produce harmonically unpleasant results.
However, such individuals should be eliminated in the reproduction process.
The most interesting part of the system is the fitness evaluation of generated harmonic structures. Fitness evaluation is performed autonomously by the system. Fitness function utilizes common harmonization knowledge used in standard four-part
harmony writing. Harmonization knowledge in the system captures various types of
possible harmonic structures while some of them are preferred and some are not.
The evaluation of harmonic occurrences is performed on two levels, within voices
and between voices. For instance, within voices a stepwise progression is preferred
over large leaps, while dissonant chords and some kinds of leaps are penalized. Between voices, occurrences of parallel unison, parallel octaves or progression from
diminished 5th to perfect 5th, or crossing voices are penalized. More details on fitness evaluation can be found in [6].
Since the system evaluates only the harmonic movements between two adjacent
chords, it is not possible to compose large-scale and sophisticated harmonic progressions.
Authors also have developed a different version of the system which uses a rulebased inference engine instead of genetic algorithm. A comparison between the
systems has been made and the rule-based implementation has delivered substantially better results [6]. It is a quite presumable result, since the rule-based approach
seems to be more appropriate for harmonization tasks than genetic algorithm. The
process of writing harmonies is a well examined part of music composition theory,
but genetic algorithms provide rather an unstructured search in the problem domain.
6 CONGA
CONGA (COmposition iN Genetic Approach) [45] is an evolutionary drum machine that generates multi-timbre rhythm patterns. To generating rhythms, a combination of genetic algorithm and genetic programming is used. Genetic algorithm is
used to breed individuals, usually one measure long rhythm phrases that are further
arranged into 416 measures long rhythm patterns using genetic programming.
Basically, the system is interactive so that the evaluation of generated phrases
relies on the mentor. Note also that the system generates rhythm patterns without
any regard to other music, so that its purpose is much closer a drum machine rather
than a rhythm accompaniment composition system. However, CONGA also utilizes
a neural network that learns the mentors responses and provides an assistance in
evaluation of individuals.
952
M. Dostal
In CONGA, two crossover operations are available. First, standard one point
crossover which exchanges selected parts between parental chromosomes and second, a crossover operation that exchanges selected timbers between the parents.
Likewise many other genetic algorithm-based generative systems, GONGA uses
several musically meaning mutation operators:
Random. Mutates selected chromosome positions with randomly selected values
(0-127).
953
954
M. Dostal
Using that, the mentor is able to evaluate the evolved patterns with consideration of
some other music played by another MIDI devices.
As it was mentioned above, CONGA utilizes also a neural network that provides an evaluation assistance to the mentor. A three-layer back-propagation network learns the responses from the mentor. The assistance is provided in terms of
preselection of highly fit individuals to the mentor in order to reduce the psychological burden caused by evaluation of each evolved individual.
7 GeneticDrummer
GeneticDrummer is an evolutionary composer of rhythm accompaniment. The system has been developed between 2000 and 2002 by Dostal [17], the author of
this chapter. The system composes a matching rhythm accompaniment to the given
musical piece. Internally, it uses genetic algorithm that performs, contrary to most
evolutionary rhythm generators, autonomous quality evaluation of generated accompaniment using a fitness function. The user, however, specifies the fitness criteria in
order to define the preferred aspects of resulting rhythm accompaniment. GeneticDrummer listens also to one selected instrument part of the musical piece (e.g., a
bass-guitar or rhythm piano part) to which a rhythm accompaniment will be composed in order to produce an accompaniment that matches with the music. In GeneticDrummer, the aspect of musically meaning design of the system and the ability to
perform autonomously is strongly emphasized. The system uses musically meaning
representation that captures typical drum playing techniques and instrumentation
possibilities of individual drums available in the system. Also, the design of mutation and fitness operations attempts to be musically meaning. These aspects will be
introduced in more detail later in this section.
955
more than one note using one drum stroke. These kinds of drum strokes are great to
coloring the rhythm accompaniment with fine nuances. Fig. 7 depicts types of drum
strokes available in GeneticDrummer. That is, a drum stroke is the basic musical element in GeneticDrummer, not a note as commonly used in other rhythm generation
systems. Note also, that this approach is commonly used in drum notation, where
multiple drum strokes are identified by a particular symbol instead of writing-down
individual notes corresponding to the drum stroke type. In a pattern, drum stroke
types can be easily interchanged (e.g., single stroke to double stroke or vice versa)
and thus used to produce naturally sounding rhythm variations easily.
Drum strokes of individual drums or cymbals are encoded with integer values
called rhythm elements which are stored at individual positions in chromosomes. A
rhythm element encodes a drum stroke type and a drum stroke volume. Drum stroke
volume is specified on a six-point scale from piano to forte fortissimo. Each drum
instrument has assigned an interpretation table that is used to encode and decode
rhythm elements for individual drum instruments. For instance, Table 2 depicts the
interpretation table for the snare drum. There is also one special rhythm element:
a rest, that is encoded with the zero value. Other interpretation tables and further
details on rhythm elements can be found in [19].
956
M. Dostal
p
11
21
31
41
51
61
71
mp
12
22
32
42
52
62
72
mf
13
23
33
43
53
63
73
f
14
24
34
44
54
64
74
ff
15
25
35
45
55
65
75
fff
16
26
36
46
56
66
76
Individuals in a population are represented using multichromosomes. Multichromosomes hold one measure long rhythm patterns. A multichromosome is a list
structure composed of chromosomes. Each chromosome corresponds to a particular
percussion instrument and is composed of rhythm elements, see Fig. 8.
((chromosome
(chromosome
(chromosome
(chromosome
(chromosome
(chromosome
(chromosome
(chromosome
(chromosome
(chromosome
(chromosome
representing
representing
representing
representing
representing
representing
representing
representing
representing
representing
representing
splash cymbal)
crash cymbal 2)
crash cymbal 1)
ride cymbal)
hi-hat)
snare drum)
bass drum)
small tom-tom)
medium tom-tom)
large tom-tom)
floor-tom))
Chromosomes are encoded in a pattern-like style, that is each position corresponds to a particular duration depending on the internal resolution of the system
and the metre of multichromosome. The most commonly used internal resolution in
multichromosomes is one sixteenth-note. Using that resolution a chromosome with
4/4 metre will contain 16 positions. Fig. 9 depicts a sample multichromosome in 4/4
metre and the corresponding notation. The (empty) element represent a chromosome composed of rests, that is (00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00).
The pattern-oriented representation of rhythm is easy to use in computers, but
it does not enable to encode triplets directly. To encode triplets we use a special
value 300 that is added to the rhythm element value if a note should be shifted to a
triplet division. For instance, Fig. 10 depicts such an example of triplet coding. This
method of triplet coding was inspired with triplet coding used in pattern sequencers.
957
((empty)
(empty)
(empty)
(empty)
(14 00 14 00 14 00 14 00 44 00 74 00 24 00 15 00)
(00 00 00 00 14 00 00 00 00 00 00 00 14 00 00 00)
(14 00 00 00 00 00 14 00 14 00 00 00 00 00 00 00)
(empty)
(empty)
(empty)
(empty))
chromosome:
(14 314 314 0 14 314 314 0 14 314 314 0 14 314 314 0)
Fig. 10 Triplet coding example
As it was stated above, individuals in a population are encoded with multichromosomes. GeneticDrummer uses two populations, one for generating the accompaniment (the so called groove populaion) and one for generating rhythm breaks (the
so called break population). Rhythm breaks may appear at the last measure of a
generated phrase. Needless to say that as a groove population can also be used a set
of individuals representing drum breaks, if the user has an intention to generate a
longer drum solo.
From the musical standpoint, the population contains one measure long drum patterns of particular rhythm and drum-playing style. The populations can be composed
of typical grooves of a particular human player, for instance. In this case, the GeneticDrummer is able to, to some extent, imitate the playing style of the human player.
Another good approach to build-up populations, is to take a drum-practice book and
rewrite typical patterns of particular rhythm into multichromosomes. It was actually
the most frequently used approach to build-up the populations for experimenting
with GeneticDrummer. The last, a quite appealing, possibility is to record drum
patterns played live by the human drummer on drum pads using a MIDI drum
trigger module and afterwards transform these MIDI data into the format of
958
M. Dostal
959
960
M. Dostal
(lambda (music)
(mutation-bass-teamwork notes-cc-1 0.06 music)
(mutation-bass-teamwork notes-bass 0.06 music))
Fig. 11 Mutation function example
(lambda
(+ (*
(*
(*
(*
(*
(*
(*
(*
(music)
10 (instrument-quantity notes-snare 0.2))
10 (instrument-quantity notes-tt-10 0.2))
10 (instrument-quantity notes-tt-12 0.2))
10 (instrument-quantity notes-tt-13 0.2))
20 (rhythm-conformity notes-snare music))
20 (rhythm-conformity notes-tt-10 music))
20 (rhythm-conformity notes-tt-12 music))
20 (rhythm-conformity notes-tt-13 music))))
One run of the genetic algorithm produces one measure long rhythm accompaniment to one measure of accompanying music. The inputs to genetic algorithm are
following: a population, a fitness function, a mutation function, a measure of accompanying music and the parameters applied to genetic algorithm such as the number
of generations, or starting position for generating a break. After passing the given
number of generating the individual with highest fitness is returned as result.
The rhythm accompaniment to a complete phrase is generated by the repeated
application of the genetic algorithm with the same parameters except the measure
with accompanying instrument which is obviously set to the next measure before
generating next measure of rhythm accompaniment. After generating all measures
of the rhythm accompaniment, the genetic algorithm is executed once again in order to generate a break. A break population is used instead the groove population
and also the fitness and mutation is defined specifically for generating a break. Afterwards the last measure of generated groove and generated break are combined
together according to the system settings: a user can set at which bar should the
break start.
961
is relatively easy for the user. GeneticDrummer communicates with the Cakewalk
ProAudio, a well known DAW application.
The author is developing a new, more advanced version of GeneticDrummer that
is about to be introduced in 2012.
Listening
GeneticDrummer has been used in various genres, such as jazz, rock or latin. Note,
that the below presented results represent a rough result from the GeneticDrummer
and thus they were not edited afterwards by the user in any way, except for sound
processing.
1. Chicken, funk classic by Pee Wee Ellis.
http://dostal.inf.upol.cz/data/mp3/chicken-2011.mp3
The bass guitar part was used as music accompanying track to which the drum
accompaniment was evolved.
2. A Night in Tunisia, a jazz standard written by Dizzy Gillespie.
http://dostal.inf.upol.cz/data/mp3/nit.mp3
3. Blue Bossa, an instrumental jazz tune written by Kenny Dorham.
http://dostal.inf.upol.cz/data/mp3/bluebossa.mp3
4. Summertime, from Porgy and Bess opera written by George Gershwin.
http://dostal.inf.upol.cz/data/mp3/summertime.mp3
5. Sockshop, a typical rock and roll tune.
http://dostal.inf.upol.cz/data/mp3/sockshop.mp3
Used groove population:
http://dostal.inf.upol.cz/data/mp3/
sockshop-groove-pop.mp3
Poulation used for breaks:
http://dostal.inf.upol.cz/data/mp3/
sockshop-break-pop.mp3.
8 Conclusion
Evolutionary music composition has become widely used and popular technique
in algorithmic composition. Seemingly, the interest of researchers is growing; the
number of various conferences, workshops and books on algorithmic composition
is growing. Also, there are artists interested in utilization of algorithmic composition
techniques in their artworks. Some music composition systems, such as GenDash or
GenJam have appeared in various compositions or live performances. GenJam has
been used on around 300 various jazz tunes. The system is also used by the author
in his VirtualQuintet on various recordings, tutorials and live gigs.
However, there is a field of problems that require further systematic investigation
including finding promising representation, measurement of aesthetic criteria or developing a theoretical background on generative art. McCormack in his work [37]
formulates and discusses five open problems in evolutionary art in detail.
962
M. Dostal
References
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
963
23. Harley, J.: Algorithms adapted from chaos theory: Compositional considerations.
In: Proc. of the 1994 International Computer Music Conference, Aarhus, Denmark,
pp. 209212 (1994)
24. Herman, M.: Deterministic chaos, iterative models, dynamical systems and their application in algorithmic composition. In: Proceedings of the International Computer Music
Conference (1993)
25. Hild, H., Feulner, J., Menzel, W.: Harmonet: A neural net for harmonizing chorales in the
style of j. s. bach. In: Moody, J.E., Hanson, S.J., Lippmann, R. (eds.) NIPS, pp. 267274.
Morgan Kaufmann (1991)
26. Hoover, A.K., Rosario, M.P., Stanley, K.O.: Scaffolding for interactively evolving novel
drum tracks for existing songs. In: Proceedings of the 2008 Conference on Applications
of Evolutionary Computing, Evo 2008, pp. 412422. Springer, Heidelberg (2008)
27. Hoover, A.K., Szerlip, P.A., Stanley, K.O.: Interactively evolving harmonies through
functional scaffolding. In: Proceedings of the 13th Annual Conference on Genetic and
Evolutionary Computation, GECCO 2011, pp. 387394. ACM, New York (2011)
28. Horner, A., Ayers, L.: Harmonisation of musical progressions with genetic algorithms.
In: Proceedings of the 1995 International Computer Music Conference, pp. 483484.
ICMA, San Francisco (1995)
29. Horner, A., Goldberg, D.E.: Genetic algorithms and Computer-Assisted music composition. In: International Conference on Genetic Algorithms, pp. 437441 (1991)
30. Horowitz, D.: Generating rhythms with genetic algorithms. In: Proceedings of the 1994
International Computer Music Conference, pp. 142143. ICMA, San Francisco (1994)
31. Jacob, B.L.: Composing with genetic algorithms. In: International Computer Music Conference (January 1995)
32. Jacob, B.L.: Algorithmic composition as a model of creativity. Org. Sound 1, 157165
(1996)
33. Johanson, B., Poli, R.: GP-music: an interactive genetic programming system for music generation with automated fitness raters. In: Proceedings of the Third International
Conference on Genetic Programming (1998)
34. Keller, R.M., Morrison, D.R.: A grammatical approach to automatic improvisation.
Technical report
35. Koza, J.R.: Genetic programming - on the programming of computers by means of natural selection. In: Complex Adaptive Systems. MIT Press (1993)
36. Livio, M.: The Golden Ratio: The Story of Phi, the Worlds Most Astonishing Number.
Broadway Books (2002)
37. McCormack, J.: Open Problems in Evolutionary Music and Art. In: Rothlauf, F., Branke,
J., Cagnoni, S., Corne, D.W., Drechsler, R., Jin, Y., Machado, P., Marchiori, E., Romero,
J., Smith, G.D., Squillero, G. (eds.) EvoWorkshops 2005. LNCS, vol. 3449, pp. 428436.
Springer, Heidelberg (2005)
38. McIntyre, R.A.: Bach in a box: The evolution of four part baroque harmony using the
genetic algorithm. In: International Conference on Evolutionary Computation, pp. 852
857 (1994)
39. Moore, J.H.: Gamusic: Genetic algorithm to evolve musical melodies (1994)
40. Ralley, D.: Genetic algorithms as a tool for melodic development. In: Proceedings of the
International Computer Music Conference, Banff, Canada, pp. 501502 (1995)
41. Roads, C.: Grammars as representations for music. In: Roads, C., Strawn, J. (eds.) Foundations of Computer Music, pp. 403442. MIT Press, Cambridge (1985)
964
M. Dostal
42. Spector, L., Alpern, A.: Criticism, culture, and the automatic generation of artworks. In:
AAAI 1994: Proceedings of the Twelfth National Conference on Artificial Intelligence,
vol. 1, pp. 38. American Association for Artificial Intelligence, Menlo Park (1994)
43. Spector, L., Alpern, A.: Induction and recapitulation of deep musical structure. In: Proceedings of the IFCAI 1995 Workshop on Artificial Intelligence and Music, pp. 4148
(1995)
44. Thywissen, K.: Genotator: an environment for investigating the application of genetic
algorithms in computer assisted composition. In: Proceedings of the 1996 International
Computer Music Conference, pp. 274277. ICMA, San Francisco (1996)
45. Tokui, N., Iba, H.: Music composition with interactive evolutionary computation. In:
Proceedings of the Generative Art International Conference, Milan, Italy (2000)
46. Tsang, C.P., Aitken, M.: Harmonizing music as a discipline of constraint logic programming. In: Proceedings of then International Computer Music Conference (1991)
47. Unemi, T.: A design of genetic encoding for breeding short musical pieces. In: Workshop
on Artificial Life Models for Musical Applications II: Search for Musical Creativity,
pp. 2529 (2002)
48. Unemi, T.: Sbeat3: a tool for multi-part music composition by simulated breeding. In:
Proceedings of the Eighth International Conference on Artificial Life, pp. 410413. MIT
Press, Cambridge (2003)
49. Waschka, R.: Avoiding the fitness bottleneck using genetic algorithms to compose
orchestral music. In: Proceedings of the International Computer Music Conference,
pp. 201203 (1999)
50. Waschka, R.: Composing with Genetic Algorithms: GenDash, ch. 6, pp. 117136.
Springer (2007)
51. Waschka, R.: Theories of evolutionary algorithms and a new simplicity opera: Making
sapphos breath. In: Artificial Life Models for Musical Applications, pp. 7986 (2011)
52. Wiggins, G.A.: Automated generation of musical harmony: whats missing? In: Proceedings of the International Joint Conference in Artifical Intelligence 1999, IJCAI 1999
(1999)
53. Xenakis, I.: Formalized music thought and mathematics in composition. Indiana university press (1971)
54. Xenakis, I.: Formalized music: thought and mathematics in composition. Harmonologia
series. Pendragon Press (1992)