Implement a genetic algorithm in Python to automatically generate melody harmonizations. Dive into the intricacies of genetic algorithms applied to music composition, exploring concepts such as population initialization, parent selection, crossover, mutation, and fitness evaluation. Learn how to create a MelodyData class, develop a GeneticMelodyHarmonizer, and implement various fitness criteria including chord-melody congruence, chord variety, harmonic flow, and functional harmony. Follow along with code examples, gain insights into the main function's structure, and discover how to further explore and expand upon the provided code for advanced melody harmonization techniques.
Melody Harmonization with Genetic Algorithms - Generative Music AI Course