Giter Site home page Giter Site logo

folkduet's Introduction

FolkDuet: When Counterpoint Meets Chinese Folk Melodies

[paper] | [project page]

Introduction

This is the official implementation of When Counterpoint Meets Chinese Folk Melodies (NeurIPS'2020) paper.

In this work, we propose a system named FolkDuet to automatically generate countermelodies for Chinese folk melodies, modelling the counterpoint concept in Western music theory while maintaining the Chinese folk style. FolkDuet is designed to support real-time human-machine collaborative duet improvisation, hence the algorithm is causal.

Dependencies

the following python packages are required

  • torch==0.4.1 (we do not know why, but torch 1.x will give different (and of course worse) results, so please use torch 0.4.1)
  • numpy
  • music21
  • glog

Usage

How to run

1.train Bach-HM and Bach-M model

python3 main_note.py --arch BachHM --batch_size 256 --lr 0.05 --nfc_left 256 --nhid 128 --exp_dir results/bachHM
python3 main_note.py --arch BachM --batch_size 256 --lr 0.05 --nfc_left 512 --nhid 256 --exp_dir results/bachM

2.train initialization models for Generator and StyleRewarder

python3 main_note.py --arch Generator --batch_size 512 --folk --lr 0.1 --nfc_left 512 --nhid 256 --exp_dir results/generator_init --raw
python3 main_note.py --arch StyleRewarder --batch_size 512 --folk --lr 0.05 --nfc_left 512 --nhid 256 --exp_dir results/style_init

3.use RL and IRL to train the Generator and StyleRewarder

python3 irl.py --bach_both results/bachHM --bach_self results/bachM --check_dir results/generator_init --reward_dir results/style_init --exp_dir results/irl --raw

How to sample music

python3 sample.py --check_dir results/pretrained

Citations

Please consider citing our paper in your publications, if the project helps your research. BibTeX reference is as follows.

@article{jiang2020counterpoint,
  title={When Counterpoint Meets Chinese Folk Melodies},
  author={Jiang, Nan and Jin, Sheng and Duan, Zhiyao and Zhang, Changshui},
  journal={Advances in Neural Information Processing Systems},
  volume={33},
  year={2020}
}

License

This code is freely available for free non-commercial use, and may be redistributed under these conditions. Please, see the LICENSE for further details. Third-party datasets and softwares are subject to their respective licenses.

folkduet's People

Contributors

jin-s13 avatar nina124 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.