Giter VIP home page Giter VIP logo

performance-rnn-pytorch's Introduction

Performance RNN - PyTorch

PyTorch implementation of Performance RNN, inspired by Ian Simon and Sageev Oore. "Performance RNN: Generating Music with Expressive Timing and Dynamics." Magenta Blog, 2017. https://magenta.tensorflow.org/performance-rnn.

This model is not implemented in the official way!

Pretrained Model - Loss ~ 0.85

Model trained for about 8 hours

Example Songs:

Pythagorus's Deep Journey

Directory Structure

.
├── dataset/
│   ├── midi/
│   │   ├── dataset1/
│   │   │   └── *.mid
│   │   └── dataset2/
│   │       └── *.mid
│   ├── processed/
│   │   └── dataset1/
│   │       └── *.data (preprocess.py)
│   └── scripts/
│       └── *.sh (dataset download scripts)
├── output/
│   └── *.mid (generate.py)
├── save/
│   └── *.sess (train.py)
└── runs/ (tensorboard logdir)

Getting Started

  • Download datasets

    cd dataset/
    bash scripts/NAME_scraper.sh midi/NAME
  • Preprocessing

    # Preprocess all MIDI files under dataset/midi/NAME
    python3 preprocess.py dataset/midi/NAME dataset/processed/NAME
  • Training

    # Train on .data files in dataset/processed/MYDATA, and save to save/myModel.sess every 10s
    python3 train.py -s save/myModel.sess -d dataset/processed/MYDATA -i 10
    
    # Or...
    python3 train.py -s save/myModel.sess -d dataset/processed/MYDATA -p hidden_dim=1024
    python3 train.py -s save/myModel.sess -d dataset/processed/MYDATA -b 128 -c 0.3
    python3 train.py -s save/myModel.sess -d dataset/processed/MYDATA -w 100 -S 10
  • Generating

    # Generate with control sequence from test.data and model from save/test.sess
    python3 generate.py -s save/test.sess -c test.data
    
    # Generate with pitch histogram and note density (C major scale) <- Use this one 
    python3 generate.py -s save/test.sess -l 1000 -c '1,0,1,0,1,1,0,1,0,1,0,1;3'
    
    # Or...
    python3 generate.py -s save/test.sess -l 1000 -c ';3' # uniform pitch histogram
    python3 generate.py -s save/test.sess -l 1000 # no control
    
    # Use control sequence from processed data
    python3 generate.py -s save/test.sess -c dataset/processed/some/processed.data

Requirements

  • python 3.5
  • pretty_midi
  • numpy
  • pytorch
  • tensorboardX
  • progress

performance-rnn-pytorch's People

Contributors

djosix avatar glenncameron2 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.