Modified Wavenet that works on MIDI files.
pytorch>=1.1.0
tqdm
numpy
pretty-midi
matplotlib
tb-nightly>=1.14.0
CUDA & cudnn is neccessary. Use whatever version that suits your libraries.
Assumes training uses GPUs, will throw error if no CUDA-capable GPUs are present.
Have tested on 1-GPU & 4-GPU environments.
Training data that I used are from two sources:
The Lakh MIDI Dataset v1.1: LMD_matched was used.
The Largest MIDI Collection on the Internet: A small subset was used.
Extract additional datasets under /Datasets.
For fast preparation of filenames, all filenames are indexed in a text file under /Datasets. Add additional files if neccessary.
Run
python3 train.py
All hyperparameters are modifiable via flags. Please refer to train.py for specifics.
Make sure your checkpoint is under /Checkpoints.
Then, run
python3 train.py --sample NUMBER_OF_SAMPLES --resume RESUME_CHECKPOINT_NUMBER
If no --resume flag is given, the checkpoint with the largest number in its name will be selected.
Generated samples & piano roll image files will be under /Samples.
Enable general generation of MIDI files: Currently only able to generate classical music.
-> General generation is now possible: only need to expand dataset. Unfortunately, specifying genre is currently impossible.
Add length flag for sampling: Currently fixed at 4096 time steps. (~43 seconds)
-> Added length flag. Unit of length: 1/96 (s).
-> Currently, MIDIWavenet decided when to end. Maxes out in 10000 time steps, or ~100 seconds.
Improve quality of generated music.
- Rick-McCoy - Initial work - Rick-McCoy
This project is licensed under the MIT License.
- Jin-Jung Kim - General structure of code adapted - golbin
- Vincent Hermann - pytorch-wavenet repository was a big help - vincenthermann
- Everyone Else I Questioned - Thanks!