Giter Site home page Giter Site logo

midihum's Introduction

midihum

midihum (the tool formerly known as rachel) is a command-line tool for humanizing MIDI -- that is, for taking as input MIDI compositions and producing as output those same compositions with new velocity (loudness/dynamics) values for each of the contained notes. It uses gradient boosted trees, with ~400 engineered features, and is trained on 2.6K competition piano performances. For more information, see this blog post.

midihum requires Python 3. It has been tested on macOS Ventura 13.0.1 and Debian 11.

Usage

Using midihum is easy. First clone the repository, navigate to the midihum/ directory, and install dependencies:

pip install -r requirements.txt

Then -- making sure you're still in the midihum/ directory -- simply:

python main.py humanize /path/to/file.mid /path/to/humanized_file.mid

(Or use python3 instead of python if that is your Python 3 binary.)

Performance

The midihum program performs surprisingly well, at least for solo piano works of roughly the type it was trained on, i.e., from the Baroque, Classical, and especially Romantic periods of Western art music. Here are the true velocities and the predicted velocities for nine randomly chosen, not-cherry-picked performances from the validation set:

True versus predicted velocity scatter plot

In the above plot, each dot is a note on event, randomly sampled from the piece. For the same nine pieces, the model also captures the dynamics over the course of the composition well:

True versus predicted velocities over time

Model

The program uses XGBoost gradient boosted trees for its model, where each observation is one MIDI "note on" event (see midihum_model.py), with a large (~400) set of derived features (see midi_to_df_conversion.py).

Acknowledgements

The model is trained on 2,579 performances from the International Piano-e-Competition for pianists aged 35 and under. The midihum tool is dedicated to those talented young performers.

midihum's People

Contributors

erwald 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.