Skip to content

A project for the generation of MIDI files through deep learning

Notifications You must be signed in to change notification settings

nicksam112/DeepMIDI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepMIDI

A project for the generation of MIDI files through deep learning.

This project uses Keras | Tensorflow | and Mido to train and produce models that can generate single track MIDI music. The MIDI files needs to be parsed before they can be fed into the model, for now I've provided the files necessary to train the model on a small corpus of Bach songs. I'll be cleaning and uploading the parser at a later date. Two types of models are included, a Convolutional model and an LSTM model to try and compare how well each produces music. They're each trained by giving them a sample of music, and being asked to predict the next note. The LSTM model tends to do better, and I've found an accuracy of 40-50% is typically enough to start producing ok sounding music.

Example of a short song produced with the LSTM model

I tend to use this site for testing MIDI files as I don't have a MIDI player on my own device: link

Command Flags              Usage
--run Runs the model and produces a song. use --save_song_path to give it an output path and --load_weights to load a certain weights file
--train Train model, be sure to define weights save path with --save_weights
--conv Use 1D Convolution Model instead of LSTM
--load_weights Weights file to load
--save_weights Save weights as
--midi_data_path Path to midi data
--save_song_path Path to save produced song

About

A project for the generation of MIDI files through deep learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages