项目作者: Rick-McCoy

项目描述 :
Generates MIDI files with Wavenet structures.
高级语言: Python
项目地址: git://github.com/Rick-McCoy/MIDIWavenet.git
创建时间: 2018-11-25T13:26:27Z
项目社区:https://github.com/Rick-McCoy/MIDIWavenet

开源协议:MIT License

下载


MIDIWavenet

Modified Wavenet that works on MIDI files.

Getting Started

Prerequisites

  1. pytorch>=1.1.0
  2. tqdm
  3. numpy
  4. pretty-midi
  5. matplotlib
  6. tb-nightly>=1.14.0

Installing

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.

Datasets

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.

Training

Run

  1. python3 train.py

All hyperparameters are modifiable via flags. Please refer to train.py for specifics.

Sampling

Make sure your checkpoint is under /Checkpoints.

Then, run

  1. 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.

TODOs

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.

Authors

License

This project is licensed under the MIT License.

Acknowledgments

  • Jin-Jung Kim - General structure of code adapted - golbin
  • Vincent Hermann - pytorch-wavenet repository was a big help - vincenthermann
  • Everyone Else I Questioned - Thanks!