Coder Social home page Coder Social logo

modelattackdecay-for-piano-transcription's Introduction

modelAttackDecay-for-piano-transcription

Implementation of an attack/decay model for piano transcription

The code implements the estimation approach in

T. Cheng, M. Mauch, E. Benetos, and S. Dixon, 
“An attack/decay model for piano transcription,” 
in ISMIR, 2016.

The paper proposes a method based on non-negative matrix factorisation, with the following three refinements: (1) introduction of attack and harmonic decay components; (2) use of a spike-shaped note activation that is shared by these components; (3) modelling the harmonic decay with an exponential function.

Transcription is performed in a supervised way, with the training and test datasets produced by the same piano. First we train parameters for the attack and decay components on isolated notes, then update only the note activations for transcription.

How to run

  1. Clone the directory
 $ git clone https://github.com/beiciliang/modelAttackDecay-for-piano-transcription.git
  1. Install the requirements using pip
$ cd modelAttackDecay-for-piano-transcription
$ pip install --user -r requirements.txt
  1. Run the python file

To train parameters on isolated notes (20 example piano audio file ./data/note-*.wav):

$ python train-template.py

This will save the trained parameters in file ./result/templates.mat.

Transcription of example piano audio file ./data/arpeggio-example.wav uses the above templates to update the note activations by:

$ python nmf-transcription.py arpeggio-example

It will return:

Transcription result of ./data/arpeggio-example.wav
for each row of the result, it shows: onset time, offset time, note midi no.
[[  0.48   1.2   60.  ]
 [  0.74   4.12  64.  ]
 [  0.98   4.12  67.  ]
 [  1.22   1.96  72.  ]
 [  1.48   2.08  76.  ]
 [  1.74   2.28  79.  ]
 [  1.98   2.42  84.  ]]

Transcription result is saved in ./result/arpeggio-example-transcription.npy, so as the piano roll representation in ./result/arpeggio-example-pianoroll.npy.

If you wish to train and test on your own audio data, please change the parameters at each python script.

P.S. A matlab implementation is provided at Tian Cheng's soundsoftware repository.

modelattackdecay-for-piano-transcription's People

Contributors

beiciliang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sicachang

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.