Update 2024: I coded this in high school. Safe to say, it's not the best code. I'm keeping it here for posterity and potential future updates.
This program generates a set of melodies based on the key that the user inputs. The melodies are evolved using a genetic algorithm for a specified number of generations. The fitness function of the genetic algorithm currently takes into account melodic smoothness and rhythm. The program outputs the melodies as MIDI files in the same directory as the genetic.py script
pip install -r requirements.txt
python genetic.py