Git Product home page Git Product logo

groove2groove's Introduction

Groove2Groove

This is the source code for the IEEE TASLP paper:

Ondřej Cífka, Umut Şimşekli and Gaël Richard. "Groove2Groove: One-Shot Music Style Transfer with Supervision from Synthetic Data." IEEE/ACM Transactions on Audio, Speech, and Language Processing, 28:2638–2650, 2020. doi: 10.1109/TASLP.2020.3019642.

If you use the code in your research, please reference the paper.

Links

🔬 Paper postprint [pdf]
🎹 Supplementary website with examples and a live demo
🎵 Examples on YouTube
📁 MIDI file dataset, containing almost 3000 different styles
🤖 Band-in-a-Box automation scripts for generating the dataset
🧠 Model parameters (to be extracted into experiments)

Looking around

  • code: the main codebase (a Python package called groove2groove)
  • data: scripts needed to prepare the datasets
  • experiments: experiment configuration files
  • experiments/eval: evaluation code (see the eval.ipynb notebook)
  • api: an API server for the web demo

Installation

Clone the repository, then run the following commands.

  1. Install the dependencies using one of the following options:

    • Create a new environment using conda:

      conda env create -f environment.yml

      This will also install the correct versions of Python and the CUDA and CuDNN libraries.

    • Using pip (a virtual environment is recommended):

      pip install -r requirements.txt

      You will need Python 3.6 because we use a version of TensorFlow which is not available from PyPI for more recent Python versions.

    The code has been tested with TensorFlow 1.12, CUDA 9.0 and CuDNN 7.6.0. Other versions of TensorFlow (1.x) may work too.

  2. Install the package with:

    pip install './code[gpu]'

Usage

The main entry point of the package is the groove2groove.models.roll2seq_style_transfer module, which takes care of training and running the model. Run python -m groove2groove.models.roll2seq_style_transfer -h to see the available command line arguments.

The train command runs the training:

python -m groove2groove.models.roll2seq_style_transfer --logdir $LOGDIR train

Replace $LOGDIR with the model directory, containing the model.yaml configuration file (e.g. one of the directories under experiments).

To run a trained model on a single pair of MIDI files, use the run-midi command, e.g.:

python -m groove2groove.models.roll2seq_style_transfer --logdir $LOGDIR run-midi \
    --sample --softmax-temperature 0.6 \
    content.mid style.mid output.mid

To run it on a whole pre-processed dataset (e.g. the one in data/bodhidharma), use the run-test command, e.g.:

python -m groove2groove.models.roll2seq_style_transfer --logdir $LOGDIR run-test \
    --sample --softmax-temperature 0.6 --batch-size 128 \
    content.db style.db keypairs.tsv output.db 

Here, keypairs.tsv lists on each line a key from content.db and a key from style.db to use as inputs. Note that content.db and style.db may be the same file.

Acknowledgment

This work has received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No. 765068.

Copyright notice

Copyright 2019–2020 Ondřej Cífka of Télécom Paris, Institut Polytechnique de Paris.
All rights reserved.

groove2groove's People

Contributors

cifkao avatar ivanlmh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.