

Music Composing AI
During this project I created a genetic algorithm using LISP that used concepts of music to select for a more fit (and hopefully more musical) sequence of notes.
Genetic Algorithms
Genetic Algithms are a biologically inspired algorithm that creates optimal solutions using impitations of the bioloigcal processes natural selection, mutation, and reproduction. Genetic algorithms also have great potential in terms of the creation of creative solutions, as long as the genetic rules are created in a way that doesn't limit potential creativity and are accurate constraints that guide the creative process
Genetic Algorithm Structure

Process: Waterfall Method
Outline the Requirements
Designed Software
Coded one Step
Tested Software
Coded next step and tested
The Structure of the Algorithm
This algorithm divides durations and pitches into two separate groups that it can operate on, it does this for each group
1. Generates a population of individuals
2. Selects some of that population (based on fitness)
3. Copies them to the next population
4. Selects individuals to crossover
5. Fills the rest of the next generation
6. Does this for a specified number of generations
7. Combines each group into a song that has pitch and duration.
Goals of the Algorithm
I spent a good amount of time researching music theory and what characteristics differentiated music from random noise. This is a remarkably complicated area so I focused on a few areas that were reasonable to accomplish in a semester long project.
My algorithm thus has the goal to make:
-
Music with stepwise motion
-
Music that rose or fell in groups of three notes
-
Music that fell within the time signature 4-4
-
Music with repeating patterns of durations
Genetic Operators
Mutation
My program’s basic form of mutation takes one value out of the string and changes it to another value, chosen randomly.

Crossover
Uses a two-point crossover. It takes the beginning and end of one parent, and the middle part comes from another parent.
L-system mutation
-
1st generation Koch curve: ( ABACACABA)
-
Takes a random seven notes from the more fit parent, this represents the A, then it takes a random seven notes from the less fit parent, this is the B, then it takes a random seven notes from the more fit one, to be the C. It combines them in this order
