A Genetic Algorithm for Composing Music

Dragan Matić

In this paper, a genetic algorithm for making music compositions is presented. Position based representation of rhythm and relative representation of pitches, based on measuring relation from starting pitch, allow for a flexible and robust way for encoding music compositions. This approach includes a pre-defined rhythm applied to initial population, giving good starting solutions. Modified genetic operators enable significantly changing scheduling of pitches and breaks, which can restore good genetic material and prevent from premature convergence in bad suboptimal solutions. Beside main principles of the algorithm and methodology of development, in this paper the analysis of solutions in general is also presented, as well as the analysis of the obtained solutions in relation to the key parameters. Some solutions are presented in the musical score.