Skip to content

A project using RNNs made of LSTM units to generate melodies. Two melody generation systems were implemented which learn on a set of training melodies to generate novel melodies of their own. Gen-pitch learns solely on note pitch, Gen-duration learns on both note pitch and duration. Melodies are in MIDI format. Models were implemented using Keras.

Notifications You must be signed in to change notification settings

nathanclairmonte/melody-generation-RNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Recurrent Neural Networks for Melody Generation

How to Run:

  • This repo contains four main Python files:

      train_pitch.py

      train_duration.py

      gen_pitch.py

      gen_duration.py

  • First, the necessary packages must be installed: pip install -r requirements.txt.
  • Generating melodies from existing pre-trained weights:
    • To generate a melody with the Gen-pitch system based on the existing pre-trained weights, run: python src/gen_pitch.py.
    • To generate a melody with the Gen-duration system based on the existing pre-trained weights, run: python src/gen_duration.py.
  • Training the models:
    • To train the Gen-pitch system, run: python src/train_pitch.py. A melody can then be generated using the command given above.
    • To train the Gen-duration system, run: python src/train_duration.py. A melody can then be generated using the command given above.
    • N.B. You will have to change the name of the weights file in gen_pitch.py or gen_duration.py to the filename of the weights you just trained.
  • N.B. The melody files generated by gen_pitch.py and gen_duration.py are MIDI files. In order to listen to them, you can use the EXE file included in the repo, called MidiPlayer.exe. This is a small program that facilitates listening to MIDI files.
  • If you would like to learn more about how these melody generation systems work, please see the report included in this repo.

About

A project using RNNs made of LSTM units to generate melodies. Two melody generation systems were implemented which learn on a set of training melodies to generate novel melodies of their own. Gen-pitch learns solely on note pitch, Gen-duration learns on both note pitch and duration. Melodies are in MIDI format. Models were implemented using Keras.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published