melody generation with evolutionary computation

26
Melody Generation with Evolutionary Computation By Matt Johnson November 14, 2003

Upload: lacy

Post on 16-Jan-2016

28 views

Category:

Documents


0 download

DESCRIPTION

Melody Generation with Evolutionary Computation. By Matt Johnson November 14, 2003. Main Topics. Goal of Research Why use an EA? Problem Solving Approach Representation Fitness, Mutation, Reproduction The Next Step. Goal of Research. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Melody Generation with Evolutionary Computation

Melody Generation with Evolutionary Computation

By Matt Johnson

November 14, 2003

Page 2: Melody Generation with Evolutionary Computation

Main Topics

• Goal of Research

• Why use an EA?

• Problem Solving Approach

• Representation

• Fitness, Mutation, Reproduction

• The Next Step

Page 3: Melody Generation with Evolutionary Computation

Goal of Research

• Write a computer program that will generate a beautiful melody.

• Melody should be a traditional soprano part in the style of church hymnody.

• This melody will then be processed by CAVM so it may be heard in a harmonic context.

Page 4: Melody Generation with Evolutionary Computation

Why use an EA?

• EAs can handle complex problems.• Complexity of this problem:

– An average soprano can sing notes in the range from D1 to G2, or 18 different pitches. (see pic on next slide)

– There are 8 note durations typically found in this style of music: sixteenth, eighth, quarter, half, whole, dotted eighth, dotted quarter, dotted half.

Page 5: Melody Generation with Evolutionary Computation

Vocal ranges

Page 6: Melody Generation with Evolutionary Computation

Why use an EA? (cont)

• The number of notes found in a typical hymn can range from roughly 20 to 60. Let’s use 40 for our calculation.

• Pitches * Durations = 18 * 8 = 144 = Number of possible notes. (omitting rests)

• Think of a melody as a string of notes.• Number of potential melodies: 144^40 = 2

* 10^86 melodies to chose from.

Page 7: Melody Generation with Evolutionary Computation

Problem Solving Thoughts

• Reduce the search space by constraining the melody to notes within a key.

• Will use as much domain knowledge as possible.

• Will initialize randomly so that no known melodies are produced. – Uniqueness is required.

Page 8: Melody Generation with Evolutionary Computation

Problem Solving Approach

• Find an appropriate representation.

• Make observations about melodies and come up with a fitness function.

• Will use a basic evolutionary type algorithm and tweak it as needed.

Page 9: Melody Generation with Evolutionary Computation

Representation

• The building block of music is the note.

• A note is made up of a pitch and a duration.

• A melody is a string of notes.

• An individual in the population will be one melody.

Page 10: Melody Generation with Evolutionary Computation

About Notes...

• Scale Degree • Name• Note Length• Octave

Page 11: Melody Generation with Evolutionary Computation

Representation (cont)

• A melody is a string of notes.

• Every individual represents one melody.

Page 12: Melody Generation with Evolutionary Computation

Melody Observations

• Melodies tend to move by step.

• Jumps of an interval larger than one fifth are uncommon.

• Melodies frequently contain repeating patterns.

Page 13: Melody Generation with Evolutionary Computation

Note Movement

Page 14: Melody Generation with Evolutionary Computation

Melody Example

Page 15: Melody Generation with Evolutionary Computation

Fitness

• Reward one step changes (interval of a second)

• Reward jumps of a third, but not quite as much as stepwise changes.

• Reward jumps of a fourth and a fifth, but not quite as much as a third.

Page 16: Melody Generation with Evolutionary Computation

Fitness (cont)

• Penalize for jumps larger than a fifth.

• Penalize harshly for jumps larger than one octave.

• Penalize for melodies with a high percentage of sixteenth notes – they are hard to sing.

Page 17: Melody Generation with Evolutionary Computation

Fitness - advanced

• Search for and reward naturally occurring repetition of four or more notes.

• Search for and reward ascending and / or descending runs.

Page 18: Melody Generation with Evolutionary Computation

Reproduction

• Melodies will be ranked based on their fitness.

• A number of parents will be selected using rank based selection.

• Interesting phrases from each melody will be selected and combined to form a new melody.

Page 19: Melody Generation with Evolutionary Computation

Genetic Operators

• Play Two – concatenate two different melodies [2]

• Add Space – insert a rest into a melody [2]

• Play Twice – concatenate a melody onto itself [2]

• Shift Up – Shift every note in the string up to the next highest note [2]

Page 20: Melody Generation with Evolutionary Computation

Genetic Operators (cont)

• Phrase Start – mutate the beginning of each phrase so that it starts with the tonic note on a down beat [1]

• Perturb – mutate one note by moving it up or down one step [1]

Page 21: Melody Generation with Evolutionary Computation

Competition

• Will periodically remove the worst individuals from the population.

Page 22: Melody Generation with Evolutionary Computation

The Next Step

• Run the generated melody through CAVM.

• Evolve four parts at once.

Page 23: Melody Generation with Evolutionary Computation

Questions?

Page 24: Melody Generation with Evolutionary Computation

Related Work

• Peter Todd Gregory – “Frankensteinian Methods for Evolutionary Music Composition”

• Co-evolve hopeful singers and music critics• The female individual represents the

evolving environment and chooses the males.

• Males represent the singers.

Page 25: Melody Generation with Evolutionary Computation

Related Work (cont)

• The female maintains a note transition table.

• Table is used to select the males – the table itself evolves.

• The males evolve their songs in order to be selected.

Page 26: Melody Generation with Evolutionary Computation

References

1. G. Wiggins and G. Papadopoulos and S. Phon-Amnuaisuk and A. Tuson. "Evolutionary methods for musical composition“

2. Brad Johanson and Riccardo Poli. "GP-Music: An Interactive Genetic Programming System for Music Generation with Automated Fitness Raters"