Skip to content

A genetic algorithm that generates melodies in a user-defined key and of a user-defined tempo

Notifications You must be signed in to change notification settings

taimurshaikh/MusicGeneticAlgorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MusicGeneticAlgorithm

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

Usage

pip install -r requirements.txt
python genetic.py

About

A genetic algorithm that generates melodies in a user-defined key and of a user-defined tempo

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages