Sep 24, 2019 at 9:34 PM
Join Date: Jul 18, 2018
Location:
Posts: 8
Pronouns: he/him
hello! i thought i'd make this tool as there isn't anything like it and it might be quite useful to all the pxtone composers (i know you're out there). it does what the title says, plain and simple. while the midi file format has many nuances to it (at least, many more than what i know about it) and many features unsupported by pxtone, i've tested this tool with many different midis and i've had very good results with all of them, i dare even say almost as good as you can possibly get from this kind of conversion.
tempo changes are not supported (yet?). it might take me a while to figure this one out if i ever attempt it, though i don't think it's that much of a big deal. pitch bend is not supported as well, but i am almost positive i will add it some day or another.
there is no need to have only 1 note at a time per track; the tool will manage it and split the tracks when there are more notes playing at once.
type 0 midi files are not supported and i don't plan to add support for them as you can very easily turn a type 0 midi into a type 1 using any DAW and they aren't too common anyways.they are supported as long as they don't contain drums, but it's still much better if you turn it into a type 1 and then run the program on that.
when converting a midi, the tool will create one voice and one unit per track, plus one voice and one unit for every track that has to be split (tracks that contain more than one note playing at a time and drum tracks with more than one type of drum). the actual voice sound will be a random sound chosen out of the org210x waves or drums (chosen appropriately), which you are then free to change to more appropriate instruments. the voice names will begin with W for waves or D for drums, followed by the number of the randomly chosen wave (0-99) or drum (0-5) and the name of the respective midi track (sometimes cut short due to the 16 character limit for voice/unit names). units will just be numbered beginning from 0 and increasing by 1 for every unit. the program currently adds unnecessary units, and units which were originally a single midi track that was split don't share the same voice and their voices won't necessarily have the same instrument. i will fix these if you guys think they are big deals. also, the units originating from the same track should probably be in sequence, but who cares? they are still named properly so you can identify them.
if there is any midi the program doesn't convert, post it and i will do my best to fix it, but for the sake of my sanity please make sure that it is a proper, non-malformed midi (you can verify this if it has consistent behaviour across different programs). if instead there is anything in the resulting ptcop that you deem hasn't been converted properly or at all, just try to be as specific as possible with what doesn't seem right.
i don't guarantee anything for the so-called black midis or similar stuff. the program may crash, your pc may spontaneously combust or the FBI might raid your house. most likely, pxtone will refuse to open it as it went over one of the limitations of the ptcop format.
some pictures to showcase my program, which compare the resulting ptcop with the source midi on FL studio:
as you can see here, this sine-like volume change is no match for my program. it is precisely the same as on the midi. (from a midi of Go Straight from Streets of Rage 2)
nor is this volume change resulting from someone having a stroke on the mixer (from a midi of Slow Moon from Streets of Rage 2)
and this is Dragonforce's Through The Fire And Flames. from the picture you can only see that it has many units and that it's quite long, but there really aren't any issues with this kind of song either.
now, if in some cases it might appear to you that the events (volume, pan, etc) do not match the midi, you will find that they will at least always match when it is important for the notes being played in the unit. this is because while ptcop units can be considered the equivalent of midi tracks, there is no equivalent in the ptcop format for midi channels, so i had to (at least attempt) to work some black magic to make the midi features such as channel volume/pan change convert properly into the ptcop. this is why the events might seem incorrect at first glance in case the original midi had tracks containing notes with different channels. this is also the reason there is always a pan/volume change whenever a note starts playing, but don't worry, it's all good.
to use it just run it from console like this: midi2ptcop.exe midifile1.mid midifile2.mid ... for as many midi files as you'd like, or more simply drag all the midi files you'd like to convert on the program. all the output files will be in the same folder of the program named like the original files.
also, it should probably work on windows 10 32/64 bit, but i have reasons to believe it won't work on older windows (8, 7, xp, etc.) feedback is appreciated on this matter.
infinite thanks to Noxid for his great work with reverse engineering the .ptcop file format (https://www.cavestory.org/forums/threads/deciphering-ptcop-file-format.3786/)
latest version: 1.1.0
tempo changes are not supported (yet?). it might take me a while to figure this one out if i ever attempt it, though i don't think it's that much of a big deal. pitch bend is not supported as well, but i am almost positive i will add it some day or another.
there is no need to have only 1 note at a time per track; the tool will manage it and split the tracks when there are more notes playing at once.
when converting a midi, the tool will create one voice and one unit per track, plus one voice and one unit for every track that has to be split (tracks that contain more than one note playing at a time and drum tracks with more than one type of drum). the actual voice sound will be a random sound chosen out of the org210x waves or drums (chosen appropriately), which you are then free to change to more appropriate instruments. the voice names will begin with W for waves or D for drums, followed by the number of the randomly chosen wave (0-99) or drum (0-5) and the name of the respective midi track (sometimes cut short due to the 16 character limit for voice/unit names). units will just be numbered beginning from 0 and increasing by 1 for every unit. the program currently adds unnecessary units, and units which were originally a single midi track that was split don't share the same voice and their voices won't necessarily have the same instrument. i will fix these if you guys think they are big deals. also, the units originating from the same track should probably be in sequence, but who cares? they are still named properly so you can identify them.
if there is any midi the program doesn't convert, post it and i will do my best to fix it, but for the sake of my sanity please make sure that it is a proper, non-malformed midi (you can verify this if it has consistent behaviour across different programs). if instead there is anything in the resulting ptcop that you deem hasn't been converted properly or at all, just try to be as specific as possible with what doesn't seem right.
i don't guarantee anything for the so-called black midis or similar stuff. the program may crash, your pc may spontaneously combust or the FBI might raid your house. most likely, pxtone will refuse to open it as it went over one of the limitations of the ptcop format.
some pictures to showcase my program, which compare the resulting ptcop with the source midi on FL studio:
as you can see here, this sine-like volume change is no match for my program. it is precisely the same as on the midi. (from a midi of Go Straight from Streets of Rage 2)

nor is this volume change resulting from someone having a stroke on the mixer (from a midi of Slow Moon from Streets of Rage 2)

and this is Dragonforce's Through The Fire And Flames. from the picture you can only see that it has many units and that it's quite long, but there really aren't any issues with this kind of song either.

now, if in some cases it might appear to you that the events (volume, pan, etc) do not match the midi, you will find that they will at least always match when it is important for the notes being played in the unit. this is because while ptcop units can be considered the equivalent of midi tracks, there is no equivalent in the ptcop format for midi channels, so i had to (at least attempt) to work some black magic to make the midi features such as channel volume/pan change convert properly into the ptcop. this is why the events might seem incorrect at first glance in case the original midi had tracks containing notes with different channels. this is also the reason there is always a pan/volume change whenever a note starts playing, but don't worry, it's all good.
to use it just run it from console like this: midi2ptcop.exe midifile1.mid midifile2.mid ... for as many midi files as you'd like, or more simply drag all the midi files you'd like to convert on the program. all the output files will be in the same folder of the program named like the original files.
also, it should probably work on windows 10 32/64 bit, but i have reasons to believe it won't work on older windows (8, 7, xp, etc.) feedback is appreciated on this matter.
infinite thanks to Noxid for his great work with reverse engineering the .ptcop file format (https://www.cavestory.org/forums/threads/deciphering-ptcop-file-format.3786/)
latest version: 1.1.0
Code:
1.1.0:
- added this file
- program now waits for input before closing
- added support for RMI midi files
- added support for non entirely midi-compliant files
- added partial midi type 0 support (no drums)
- fixed dragging files onto the program
- much better starting tempo detection (not perfect yet)
- output files now have the same name as the input files
- added support for processing multiple files at once
Attachments
Last edited: