MIDI

MIDI

Midi files that are added in the project can converted into rhythm timelines.

To parse Midi files we are making use of the Open source C# library “Melanchall.DryWetMidi”, you can learn more about it here

When a file with the extension “.mid” is imported in the project it will be converted into a “MidiFileAsset”. When selecting the midi file in the Unity project you will find a very convinient button to “Create Midi To TimelineAsset”.

Image

Press that button and you will create a scriptable object that you can use to convert your midi notes into rhythm timeline notes.

Image

Assign your Midi File Asset and your target RhythmTimelineAsset

If you press the MidiTrack dropdown you’ll find all the tracks on that midi file Image

You can select a midi track to find all the midi notes available on it. Each midi note are categorized by a note ID which is linked to a pitch (i.e. E5 or G6, etc…) You’ll conviniently see how many notes of that type exist on the track.

You can then assign the TrackID, note definition and Clip Generator to be used to generate the notes on your timeline. The generated notes will have the exact timings from the midi files.