Ain't nobody got time to create MIDIs no more
This project was forked from https://github.com/Skuldur/Classical-Piano-Composer
- Python (3.9.7 or higher)
- Install dependencies
- Add your MIDIs to
data/midi
- Create a dataset using
parse_songs.py
- Train your model with the dataset using
train.py
- Generate music using
generate_midi.py
Provided below are some steps to help get started
To generate a set of data to use for training and prediction, run parse_songs.py
e.g.
python parse_songs.py dataset_name path/to/midis
To train the network run train.py
e.g.
python train.py model_name path/to/notes
If you already have a set of weights generated (from the same dataset a.k.a. notes), pass the optional flag --weights
NOTE: You can stop the process at any point in time and the weights from the latest completed epoch will be available for text generation purposes.
To generate a song using your trained model run generate_midi.py
e.g.
python generate_midi.py song_name path/to/notes path/to/weights
You can run the prediction file right away using sample_notes.pkl and sample_weights.hdf5 file
python generate_midi.py sample sample_notes.pkl sample_weights.hdf5
How do I install dependencies?
pip install -r requirements.txt
I'm getting some weird error from... tensorflow? Something with the weights...
Try running the training without loading an existing model. Starting from scratch will take longer, but the model needs to fit your dataset
I tried generating a MIDI and it just plays one note over and over
It takes a number of generations before the model fits well enought to make accurate predictions. Using loss
as a
metric, songs probably won't begin to have any coherence until reaching a values where loss < 2.0
and
ideally loss < 1.0
My
loss
value isn't going down or goes down very slowly
It may be that the initial dataset provided does not provide enough information for the model to efficiently train itself. Try training on a larger dataset