Convert polyphonic MIDI track to multiple monophonic tracks

Topics on software tools like TileStudio, comments on documentation and tutorials (or the lack of) should go here.
Post Reply
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Convert polyphonic MIDI track to multiple monophonic tracks

Post by Artcfox »

It's probably obvious that I've been on a MIDI tool improvement kick lately. ;)

This morning I was over a friend's house, and she has an 88-key MIDI keyboard, so I asked her if she could play some songs while I recorded them in Rosegarden to see what it they might sound like inside a Uzebox game.

The first problem that I ran into was the recorded track ended up being polyphonic—multiple notes were being sustained at the same time in the same track, which the Uzebox can't handle. Trying to move individual overlapping notes by hand to other tracks proved difficult, if not impossible (at least with my limited knowledge of Rosegarden).

After searching, I came across an open-source tool called p2m.py, which can ingest a single-track polyphonic midi file, and spit it out as a multi-track monophonic midi file. It worked great, and all I had to do was assign the same instrument to the multiple channels in my patch.inc file, and the Uzebox was able to correctly play back the transformed polyphonic midi file.

In case anyone else finds it useful, I've included it in the main Uzebox repository in the tools/p2m/ directory. There is a README, which explains advanced use, but all I've needed so far was the basic usage. For example, assuming you have a file called midifile.mid which contains a single polyphonic track, all you need to type at a terminal is:

Code: Select all

python p2m.py -i midisong.mid
and you will have a new file called midisong_multi.mid in the same directory as midisong.mid which contains the exact same same song, but instead of being polyphonic, it contains multiple monophonic tracks.

Happy MIDI-ing everyone! :)
User avatar
D3thAdd3r
Posts: 3175
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Convert polyphonic MIDI track to multiple monophonic tracks

Post by D3thAdd3r »

This is a big gain for Linux developers, great work!
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Convert polyphonic MIDI track to multiple monophonic tracks

Post by Artcfox »

D3thAdd3r wrote:This is a big gain for Linux developers, great work!
Thanks. :-)
Post Reply