• No results found

2.2 Formal Computational Approaches

2.2.5 Evolutionary Algorithms

The term ‘evolutionary algorithms’ refers to a collection of techniques inspired pri- marily by Darwinian natural selection [Husbands et al. 2007]. Two of these techniques which have been investigated in the field of algorithmic composition are genetic al- gorithms, and to a lesser extent genetic programming. These algorithms implement sophisticated heuristics for converging on local optimal solutions in very large search spaces. The reason for their popularity in algorithmic composition is their ability to traverse diverse regions of a space of musical solutions stochastically. This is advan- tageous for musical optimisation problems like four-part harmonisation, because it renders them no longer computationally intractable compared to expert system solu- tions like Ebcio ˇglu’s [Ebcio ˇglu 1988]. Furthermore, with a stochastic approach comes the apparent implication that new music unhindered by generative rules is possible [Gartland-Jones and Copley 2003]. Thus, while in non-artistic fields genetic algo- rithms and genetic programming are usually used to solve optimisation problems, in music they are also commonly exploited for their ‘exploration’ abilities, and are sometimes claimed to be analogous to elements of the human composition process [Gartland-Jones 2002].

Genetic algorithms (GA) are a heuristic search technique in which candidate solu-

tions are represented as a population of strings or ‘chromosomes’

[Burton and Vladimirova 1999]. Each ‘gene’ of the chromosome represents a dimen- sion of the solution space. A stochastic search process is controlled by a selection procedure based on individual ‘fitness’ and ‘reproductive’ operators to obtain suc- cessive generations of a population, and ‘mutation’ operators to randomly introduce new genetic material into an existing population. The search runs for a fixed num- ber of generations, or until the fittest individual is somehow deemed fit enough to

§2.2 Formal Computational Approaches 21

be the final solution. Reproductive operators typically implement ‘genetic crossover’ to merge a number of parents into an offspring, and mutation operators are used to modify individual genes or small sections of an offspring’s chromosome. In the sim- plest ‘traditional’ GA, individuals are represented by binary strings and genetic op- erators operate at the binary level, with crossover occurring at arbitrary points along the string and mutation operators causing random ‘bit flips’ [Engelbrecht 2007]. How- ever, for algorithmic composition most authors have found it necessary to instill the evolutionary process with a measure of musical domain knowledge to radically en- hance the process. In particular, chromosomes are used to represent musical infor- mation at a higher level of abstraction, and ‘musically meaningful’ mutation opera- tors are chosen, including the transformational procedures of inversion, reversal and transposition [Burton and Vladimirova 1999]. Fitness evaluation is usually cited as the most problematic aspect of GAs. Gartland-Jones and Copely classified genetic al- gorithms by their use of either ‘automatic’ (using an objective function or an ANN trained on a corpus) or ‘interactive’ (requiring human inspection/listening) fitness functions [Gartland-Jones and Copley 2003]. The latter are often referred to as inter- active genetic algorithms (IGAs) [Biles 2001].

Phon-Amnuaisuk et al. used a GA to create traditional four-part harmonies [Phon- Amnuaisuk et al. 1999]. They relied on an objective knowledge-based fitness function for the evaluation of chromosomes. The chromosomes encoded short thematic pas- sages, the mutation operators included ‘perturbation’, which nudges a note in a single voice up or down a semitone; ‘swapping’, where chords are altered by swapping two random voices; ‘re-chord’ which randomly modifies the chord type; ‘phrase-start’, which mutates a phrase to begin on a root chord; and ‘phrase-end’, which mutates a phrase to end on a root chord. The main reproductive procedure involved splicing the chromosome strings at a random crossover point. The fitness function was a cast of rules commonly listed in traditional voice-leading theories.

Biles presented a genetic algorithm called GenJam for generating monophonic jazz solos [Biles 1994]. GenJam initialises individuals within a population of melodic pas- sages. It performs musically meaningful mutations such as inversion, reversal, rota- tion and transposition. The fitness of each individual in a generation is determined by a human operator, and the best individuals are used as the parents of the follow- ing generation. According to Biles, this feedback process converges on solos which match the taste of the human operator [Biles 1994]. The main disadvantage of this method is that the reliance on human feedback for evaluating fitness manifests as a bottleneck which makes the convergence process orders of magnitude slower than using objective fitness functions. Biles has addressed this problem by using entire audiences instead of individual users [Biles and Eign 1995], using ANNs for fitness functions [Biles et al. 1996], and removing fitness evaluation altogether by drawing the initial population from an established database of superior specimens [Biles 2001]. Genetic programming (GP) is an extension to the GA paradigm in which the indi- viduals in the population are not vectors representing points in a solution space, but hierarchical expressions representing mathematical functions or the code for entire al- gorithms [Burton and Vladimirova 1999]. GP individuals are normally represented

as expression tree structures; consequently the selection, reproduction and mutation mechanisms are designed specifically to operate on these structures [Engelbrecht 2007]. GP fitness functions are more commonly realised as error or ‘cost’ functions because they are very popular for solving symbolic regression problems, but aside from these differences GP and GA implementations are fundamentally the same. Laine and Kuuskankare [Laine and Kuuskankare 1994], for instance, generated an initial pop- ulation of melodies using simple mathematical operators and trigonometric func- tions, then evolved the population by performing crossover and mutation on subtrees. Longer and more complex musical phrases result from the increasing complexity of the population generations. Puente et al. used a GP technique to evolve context-free grammars for producing melodies in the style of a corpus of works by several fa- mous composers [Puente et al. 2002]. In this instance the fitness function was simply a statistical comparison between the population members and the melodies from the corpus.

Burton and Vladimirova suggested that genetic techniques allow a greater scope of musical possibilities and often subjective ‘realism’ than other approaches such as ANNs, which are restricted by training data; expert systems, which are often re- stricted by computational complexity and knowledge-engineering issues; and purely stochastic generators which exhibit good unpredictability but ‘questionable musical- ity’ [Burton and Vladimirova 1999]. However, they and many other authors have ac- knowledged the perennial problem of designing effective fitness-evaluation methods that reduce the counter-productive dependence on human interaction — the ‘fitness bottleneck’ [Biles et al. 1996]. Additionally, many conundrums are ever-present in the tuning of genetic algorithm parameters, such as whether to implement ‘elitist’ se- lection policies that may converge too quickly to local optima, or policies that retain a high level of diversity and allow low-quality individuals to continue reproducing [Burton and Vladimirova 1999]. Phon-Amnuaisuk et al. discovered that despite the supposed advantages of using GAs for four-part harmonisation, a simple rule-based system was capable of achieving consistently better results as far as the GA’s fitness function was concerned [Phon-Amnuaisuk et al. 1999]. They attributed this to the GA’s lack of sufficient ‘meta-knowledge’, a natural trait for an expert system by virtue of the fact that the structure of the search process can be easily encoded in the pro- gram. They also noted the GA’s inability to guarantee globally optimal solutions (a caveat of stochastic search), and declared the GA model ill-suited to musical optimisa- tion problems. Despite all this, both interactive and non-interactive GAs continue to be used successfully for tasks like jazz improvisation [Biles 2007] and the composition of thematic bridging sections between user-supplied ‘source’ and ‘target’ passages [Gartland-Jones 2002].