Now Reading
An ML-Primarily based MIDI Humanizing Device

An ML-Primarily based MIDI Humanizing Device

2023-12-30 05:30:35

• 4 min learn

midihum is a command-line software for humanizing MIDI – that’s, for taking as enter MIDI compositions and producing as output those self same compositions with new velocity (loudness/dynamics) values for every of the contained notes. midihum makes use of gradient boosted timber, with ~400 engineered options, and is educated on 2.6K competitors piano performances. You should use it to make your digital compositions sound extra pure and expressive, and to seek out pure climaxes and moments of leisure in a composition.

Utilizing midihum is simple sufficient, in case you have a fundamental familiarity with the command line. After putting in it, you navigate to the venture listing and run

python humanize /path/to/enter.mid /path/to/output.mid

to humanize the MIDI file at /path/to/enter.mid, saving the humanized file to /path/to/output.mid.

I’ve labored on this software on and off for the previous 5 years, and have now gotten it to a state with which I’m fairly completely happy. It performs effectively, not less than for solo piano works of roughly the kind it was educated on, i.e., from the Baroque, Classical, and particularly Romantic durations of Western artwork music. For instance, the next plot exhibits the precise and predicted velocities for 9 randomly chosen (not cherry-picked) performances from the validation set. (Every dot is a MIDI “be aware on” occasion, i.e., a be aware being sounded. The notes proven are a randomly sampled subset of these within the composition, to keep away from cluttering the plot.) There’s a robust correlation between the expected and precise velocities.


For a similar 9 items, the mannequin additionally captures the dynamics over the course of the composition effectively. (It seems much less correct for the Chopin and Haydn items beneath, seemingly as a result of they’re shorter, and fewer dynamically expressive, than the others proven right here.) That’s, the software appears to appropriately establish peaks and valleys within the music’s depth, on the macro stage.


You can too see that the velocities predicted by midihum are extra excessive, within the sense that they have a tendency extra in direction of very excessive and really low values, than these carried out by people. I tuned the mannequin that manner as a result of it fits my style, however that is the results of a scaling issue utilized in post-processing, and will simply be toned all the way down to make the 2 line up higher. The distinction is particularly apparent when evaluating the distributions of velocity values, the place the tails are considerably fatter for the distribution of predicted velocities, as proven beneath.


As talked about, midihum makes use of gradient boosted timber (by way of XGBoost) for its mannequin, the place every remark is one MIDI “be aware on” occasion, with a big (~400, narrowed down from ~1K) set of engineered options. midihum’s predictive energy is generally a product of the engineered options, which have been largely impressed by devices utilized in technical analysis of shares and different securities. A few of the most necessary options, in line with the XGBoost feature_importances_ attribute, are:

See Also

The worth of some engineered options was apparent earlier than even coaching the mannequin. A few of the options had correlations with the end result (the precise velocity) of >0.25 and even >0.3. These correlations could possibly be thought-about weak on their very own, however when you’ve got many, and partly uncorrelated, such options, and a mannequin that may seize nonlinear relationships, they’re a superb signal and might get you a great distance.

The midihum mannequin was educated on performances from the Worldwide Piano-e-Competitors for pianists aged 35 and underneath. midihum is devoted to these proficient younger performers, and people who selected and carried out the recording and publishing of these performances.

NB: midihum doesn’t change the rhythmical timing of notes, nor does it have in mind dynamics notated in sheet music. It’s distributed with a GPLv3 license, which (quoting TLDRLegal) means it’s possible you’ll “copy, distribute and modify the software program so long as you monitor adjustments/dates in supply recordsdata. Any modifications to or software program together with (by way of compiler) GPL-licensed code should even be made out there underneath the GPL together with construct & set up directions.” As well as, it’s possible you’ll use the software freely to make music, together with music that you simply earn cash from, with out crediting me or this venture. I want you the perfect of luck in doing so. You will discover the complete license, in addition to the code and person directions, within the midihum GitHub repository.

Source Link

What's Your Reaction?
In Love
Not Sure
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top