allenhung1025 / LoopTest

Official repo of ISMIR-21 publication, “A Benchmarking Initiative for Audio-domain Music Generation using the FreeSound Loop Dataset”.
MIT License
77 stars 12 forks source link

LoopTest

GitHub GitHub issues GitHub Repo stars

Benchmarking Freesound Loop Dataset

Download dataset


$ gdown --id 1fQfSZgD9uWbCdID4SzVqNGhsYNXOAbK5
$ unzip freesound_mel_80_320.zip

Training

$ CUDA_VISIBLE_DEVICES=2 python train_drum.py \
    --size 64 --batch 8 --sample_dir freesound_sample_dir \
    --checkpoint_dir freesound_checkpoint \
    --iter 100000
    mel_80_320

Generate audio

$ CUDA_VISIBLE_DEVICES=2 python generate_audio.py \
    --ckpt freesound_checkpoint/100000.pt \
    --pics 2000 --data_path "./data/freesound" \
    --store_path "./generated_freesound_one_bar"

Evaluation

NDB_JS

Train the model with your loop dataset

Preprocess the Loop Dataset

In the preprocess directory and modify some settings (e.g. data path) in the codes and run them with the following orders

$ python trim_2_seconds.py # Cut loop into the single bar and stretch them to 2 second.
$ python extract_mel.py # Extract mel-spectrogram from 2-second audio.
$ python make_dataset.py 
$ python compute_mean_std.py 

Train the Model

CUDA_VISIBLE_DEVICES=2 python train_drum.py \
    --size 64 --batch 8 --sample_dir [sample_dir] \
    --checkpoint_dir [checkpoint_dir] \
    [mel-spectrogram dataset from the proprocessing]

Vocoder

We use MelGAN as the vocoder. We trained the vocoder with looperman dataset and use the vocoder in generating freesound and looperman models. The trained vocoder is in melgan directory.

References

The code comes heavily from the code below

Citation

If you find this repo useful, please kindly cite with the following information.

@inproceedings{ allenloopgen, 
    title={A Benchmarking Initiative for Audio-domain Music Generation using the {FreeSound Loop Dataset}},
    author={Tun-Min Hung and Bo-Yu Chen and Yen-Tung Yeh, and Yi-Hsuan Yang},
    booktitle = {Proc. Int. Society for Music Information Retrieval Conf.},
    year={2021},
}