Generate jazz music using an LSTM neural network.
$ pip install music21 $ pip install keras $ pip install numpy
- Set training data: Create a folder containing midi files, or use one of the ones provided.
ff_midi_songscontains music from Final Fantasy,
herbie_midi_songscontains music by Herbie Hancock.
train.py, line 20:
for f in glob.glob('herbie_midi_songs/*.mid'):, edit the folder to the folder containing your training set of midi files.
$ python train.py
- Once trained, you'll have a lot of resulting weight files, in the format
weights-improvement-***.hdf5. The most recent one will be the one you want to use.
generate.py, line 67:
model.load_weights('jazz_weights.hdf5'), set the path to the weights file.
$ python generate.py. Your resulting song will be created in the same folder as