Skip to content

fofanafi/melodyGenerator

 
 

Repository files navigation

melodyGenerator

This program generates new melodies by 'listening' to existing ones, using simple markov models. The melodies can be viewed by any program that handles MusicXML files (e.g. Finale Reader, MuseScore). It uses the music21 toolkit (http://web.mit.edu/music21).

Classes and Code Overview

melodyGenerator.py -- The main script.

model.py -- Contains all classes used for machine learning.
Model: Knows the probability distribution for the next note.
ModelCreator: Creates a new model from a corpus.
Predictor: Predicts the most probable next note.
Generator: Samples from the probability distribution to generate the next note.
Tester: Tests the accuracy of the model on the data set, using k-fold cross validation.

bachChorales.py -- Reads in Bach chorales from the music21 corpus.
popSongs.py -- Reads in pop melodies (data set not included).

Usage

To generate a new song: python melodyGenerator.py
For help: python melodyGenerator.py -h

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • OpenEdge ABL 99.8%
  • Python 0.2%