salu133445/musegan

★ 2,044⑂ 385

An AI for Music Generation

About salu133445/musegan

salu133445/musegan is an open-source project on GitHub, mainly written in Python. An AI for Music Generation It currently holds 2,044 stars and 385 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the AI Audio Projects board and on the AI AI Audio Projects list.

GitHub Repository Details

Repository salu133445/musegan · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

MuseGAN

MuseGAN is a project on music generation. In a nutshell, we aim to generate polyphonic music of multiple tracks (instruments). The proposed models are able to generate music either from scratch, or by accompanying a track given a priori by the user.

We train the model with training data collected from Lakh Pianoroll Dataset to generate pop song phrases consisting of bass, drums, guitar, piano and strings tracks.

Sample results are available here.

Important Notes

Prerequisites

__Below we assume the working directory is the repository root.__

Install dependencies

> Make sure pipenv is installed. (If not, simply run pip install pipenv.)
  # Install the dependencies
  pipenv install
  # Activate the virtual environment
  pipenv shell
  
  # Install the dependencies
  pip install -r requirements.txt
  

Prepare training data

The training data is collected from
Lakh Pianoroll Dataset (LPD), a new multitrack pianoroll dataset.
# Download the training data
./scripts/download_data.sh

Store the training data to shared memory

./scripts/process_data.sh

You can also download the training data manually (train_x_lpd_5_phr.npz).

As pianoroll matrices are generally sparse, we store only the indices of
nonzero elements and the array shape into a npz file to save space, and later restore the original array. To save some training data data into this format, simply run np.savez_compressed("data.npz", shape=data.shape, nonzero=data.nonzero())

Scripts

We provide several shell scripts for easy managing the experiments. (See here for a detailed documentation.)

__Below we assume the working directory is the repository root.__

Train a new model

1. Run the following command to set up a new experiment with default settings.

   # Set up a new experiment
   ./scripts/setup_exp.sh "./exp/my_experiment/" "Some notes on my experiment"
   

2. Modify the configuration and model parameter files for experimental settings.

3. You can either train the model:

     # Train the model
     ./scripts/run_train.sh "./exp/my_experiment/" "0"
     

or run the experiment (training + inference + interpolation):

     # Run the experiment
     ./scripts/run_exp.sh "./exp/my_experiment/" "0"
     

Collect training data

Run the following command to collect training data from MIDI files.

  # Collect training data
  ./scripts/collect_data.sh "./midi_dir/" "data/train.npy"
  

Use pretrained models

1. Download pretrained models

   # Download the pretrained models
   ./scripts/download_models.sh
   

You can also download the pretrained models manually (pretrained_models.tar.gz).

2. You can either perform inference from a trained model:

   # Run inference from a pretrained model
   ./scripts/run_inference.sh "./exp/default/" "0"
   

or perform interpolation from a trained model:

   # Run interpolation from a pretrained model
   ./scripts/run_interpolation.sh "./exp/default/" "0"
   

Outputs

By default, samples will be generated alongside the training. You can disable this behavior by setting save_samples_steps to zero in the configuration file (config.yaml). The generated will be stored in the following three formats by default.

_Pypianoroll_ package

You can disable saving in a specific format by setting save_array_samples, save_image_samples and save_pianoroll_samples to False in the configuration file.

The generated pianorolls are stored in .npz format to save space and processing time. You can use the following code to write them into MIDI files.

from pypianoroll import Multitrack

m = Multitrack('./test.npz') m.write('./test.mid')

Sample Results

Some sample results can be found in ./exp/ directory. More samples can be downloaded from the following links.

sample inference and interpolation results sample generated results at different steps

Citing ------

Please cite the following paper if you use the code provided in this repository.

Hao-Wen Dong\, Wen-Yi Hsiao\, Li-Chia Yang and Yi-Hsuan Yang, "MuseGAN: Multi-track Sequential Generative Adversarial Networks for Symbolic Music Generation and Accompaniment," _AAAI Conference on Artificial Intelligence (AAAI)_, 2018. (\*equal contribution)
[homepage] [arXiv] [paper] [slides] [code]

Papers

__MuseGAN: Multi-track Sequential Generative Adversarial Networks for Symbolic Music Generation and Accompaniment__
Hao-Wen Dong\, Wen-Yi Hsiao\, Li-Chia Yang and Yi-Hsuan Yang (\*equal contribution)
_AAAI Conference on Artificial Intelligence (AAAI)_, 2018.
[homepage] [arXiv] [paper] [slides] [code]

__Convolutional Generative Adversarial Networks with Binary Neurons for Polyphonic Music Generation__
Hao-Wen Dong and Yi-Hsuan Yang
_International Society for Music Information Retrieval Conference (ISMIR)_, 2018.
[homepage] [video] [paper] [slides] [slides (long)] [poster] [arXiv] [code]

__MuseGAN: Demonstration of a Convolutional GAN Based Model for Generating Multi-track Piano-rolls__
Hao-Wen Dong\, Wen-Yi Hsiao\, Li-Chia Yang and Yi-Hsuan Yang (\*equal contribution)
_ISMIR Late-Breaking Demos_, 2017.
[paper] [poster]

GitHub Stars & Activity

2,044Stars
385Forks
0Open issues
PythonLanguage

GitHub Popularity

GitHub stars2,044
Forks385
Open issues0
Primary languagePython
License-
Stars gained today0
Created-
Last pushed-

Trending History

Trending statusnot on today's boards

Related AI Projects

1

huggingface / transformers

Python★ 166,457⑂ 34,648
2

RVC-Boss / GPT-SoVITS

Python★ 61,994⑂ 6,671
3

coqui-ai / TTS

Python★ 46,033⑂ 6,158
4

2noise / ChatTTS

Python★ 39,856⑂ 4,260
5

OpenBMB / VoxCPM

Python★ 37,835⑂ 4,295
6

myshell-ai / OpenVoice

Python★ 37,598⑂ 4,226
7

babysor / MockingBird

Python★ 36,903⑂ 5,176
8

debpalash / VoiceStudio

Python★ 33,623⑂ 3,972

More AI Rankings