Presentation is loading. Please wait.

Presentation is loading. Please wait.

RoBach A Case Study in the Use of Genetic Algorithms for Automatic Music Composition.

Similar presentations


Presentation on theme: "RoBach A Case Study in the Use of Genetic Algorithms for Automatic Music Composition."— Presentation transcript:

1 RoBach A Case Study in the Use of Genetic Algorithms for Automatic Music Composition

2 Introduction to Music Generation First attempt: 1956, Hiller and Isaacson, Illiac Suite Many failed attempts since Unsolved problem: balancing structure and novelty More Structured More Novel Optimal Solutions

3 Music Generation Strategies Rule-based Learning by example Evolutionary corpus

4 Genetic Algorithms Purpose: robust, efficient optimization Other optimization algorithms Calculus-based: needs continuity and derivatives; local search scope (which hill to climb?) Enumerative: inefficient Random: more inefficient GAs need no auxiliary information GAs search from many places at once GAs constantly seek improvement

5 Genetic Algorithms GAs work with codings of parameters, not the parameters themselves Codings are strings in some applicable alphabet Implementation-specific requirements Routine to interpret strings Routine to judge the fitness of strings

6 Genetic Algorithms Generate population of random strings Three step generational loop: Every iteration yields ‘current best’ solution StringFitness 1 1 2 2 3 3 StringFitness ? ? ? ? ? ? M ReproductionCrossover & MutationInitial PopulationNew Population x=+ x=+ x=+

7 The Corpus - Bach’s Chorales A corpus of works provides the basis for statistical data Almost 300 Bach chorales were analyzed for histograms Frequency of intervals, chord changes, and phrases were collected Reasons for using chorales as models: Highly Structural Large existing corpus

8 The Composition Object The Composition object was designed to match the structure of a chorale 4 voices Sequential chords Serves as the interface between composers and critics Voice 1Voice 2Voice 3Voice 4 Chord List Composition

9 Introduction to Haskore Haskore is a programming environment designed for music composition It is implemented in the functional language Haskell, which is useful for list processing Haskore defines lists of music objects that can be generated and manipulated recursively Our “Composition” object contains a list of notes for each voice, making it favorable for this environment

10 Music Composer Building Blocks Each composer consists of several “building blocks” Building blocks determine the various characteristics of each composer There are two basic types of building blocks: Generators Chords Modifiers Rhythm

11 More on Building Blocks Sample composer: {a, b, c, d, e, f, g, h} Each letter represents a different building block, layered onto the composer There are an infinite number of combinations of building blocks: {a, b, c, g, e, d, a, a, a, g, e, d, …} This means an infinite number of composers, generating an infinite amount of music! abcdefgh

12 More on Building Blocks There is an infinite number of composers! Composer blocks are not commutative: {a, b} is different from {b, a} Each composer can have an unlimited number of blocks: {a, b, c, d, e, f, g, h, a, b, c, d, e, f, g, h, a, b,... } Unfortunately, not all of them are good... {a, d, e, a, b} {d, e, b, c, e, a, b} {e, c, d, d, e, b, a, b} {c, b, a}

13 Inside a Composer Defined by a “genetic sequence” Chromosome --> Word32 (32-bit binary string) 32 string can be divided any way we choose Contains code for composer’s traits Traits controlled include: Harmony Melody Rhythm Order tweaker [ 0 1 1 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 1 0 0 1 1 0 0 ] {d, d, b, a, e} {a, g, h}{e, a, h, h, h, h, h, h} {f, g, a, b, c} {c, h, g, a, a, b}

14 A Composer’s Genes Composer blocks are called by genes within the traits Each gene (binary combination) represents a composer block The number of composer blocks available -> number of bits per gene Ex. 3 bits -> 8 combinations -> 7 composer blocks Translator calls the blocks represented each combination To mix things up, tweaker mixes rhythm genes with melody genes The blocks then modify the composition 000 tells the translator to call nothing Can call multiples of the same block [ 0 1 1 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 1 0 0 1 1 0 0 ] Trait Gene 2 calls fcaabd Melody (trait) zzx f z b c x d a z a

15 Critic Building Blocks Mathematical analysis of music Histogram comparison The degree of feature similarity is analyzed with a method similar to chi-square Intervals Chord Progression Melodic Rhythms Similarities, Differences Phrasing Patterns in rhythm and intervals

16 Implementation of Critics Survival of the Fittest Composers Critic Functions In The Good The Bad

17 Different critics evaluate the same music differently, much like many people like different genres of music Having many critics will yield a variety of music, instead of allowing one type of composer to dominate Critics define weighting vectors for the critic functions, that is, how strongly they value each one in their analysis The 32-bit chromosome must define the 14 weights to create a critic The best critics are the ones that give the largest score difference between “bad” (current) music and the selected corpus Genetic Structure of the Critics: Part 1 {156, 129, …, 61} {31, 165, …, 142}{5, 2, …, 1} {19, 189, …, 54} {16, 91, …, 122}

18 Each c i is associated with a particular critic function, while d and e apply to all critic functions d is the index to the array a, containing possible values for the scaling factor a d e defines whether the scale will be power or exponential The weight of the i th critic function is given by: w i = a d ^c i, if e=0 w i = c i ^a d, if e=1 Genetic Structure of the Critics: Part 2

19 Experiment Setup Using our definitions for composer and critic blocks and chromosomes, we created an environment of 20 composers and 20 critics Each epoch consisted of: Evolve the composers for 100 generations Define the current music as the bad corpus Evolve the critics for 100 generations After many epochs had passed, we listened to the results

20 Experiment Results 10111000011101010100001000000110 Good Music 1

21 Analysis of Results Bad music Real Bach Music Good Music 2 Good Music 3 Good Music 4 Every epoch converged proving a successful genetic algorithm Music that scored poorly was worse than music that scored better Ratings improved after each epoch

22 Future Improvements More composer/critic blocks (longer string) Composer blocks implement histograms Composer blocks correspond with critic blocks Next experiment Larger population, more generation Add brand new melody modifier block

23 Adam Aaron Adam Bildersee Rebecca Cooper Malamo Countouris Carlin Eng Melissa Fritz Tim Heath Kyle Leiby Yunxue Xu Luke Zarko Special Thanks to Joel Donovan and Peter Lee! 1337 pR353N70r5


Download ppt "RoBach A Case Study in the Use of Genetic Algorithms for Automatic Music Composition."

Similar presentations


Ads by Google