Maidens of the Kaleidoscope

~Hakurei Shrine~ => Help Me, Eirin! => Topic started by: Mr. Hlaaluington on December 20, 2013, 11:57:59 PM

Title: OPN/OPNA Decompiler Wanted
Post by: Mr. Hlaaluington on December 20, 2013, 11:57:59 PM
I know software exists where you can compile .MML files into .M files. But I want to do the opposite: I need to decompile the .M files into .MML files. So far, I have seen no such program on the internet, so I was wondering if anyone else knows of such a program or where to find it.
Title: Re: OPN/OPNA Decompiler Wanted
Post by: Mr. Hlaaluington on April 03, 2015, 01:59:02 AM
Yeah, I don't mean to necro-double-post, but after almost 2 years, I finally found an OPNA decompiler lol.
For those who want to know, it is called, "PMDRC." So far, it is the only program I know of that decompiles .M files into .MML files. The only problem with it is that it doesn't convert any drums, so any MML generated through this program loses drums.

PMDRC:
http://judstyle.jp/computer/pmdrc/PMDRC101cS.LZH
Title: Re: OPN/OPNA Decompiler Wanted
Post by: Failure McFailFace on April 04, 2015, 04:27:14 PM
Is this for the PC-98 music?
Title: Re: OPN/OPNA Decompiler Wanted
Post by: Emerald Mint on April 04, 2015, 04:50:47 PM
Apparently so. Even the latest version (http://judstyle.jp/jswiki/images/9/92/PMDRC131a.zip)(found off the wiki) still dumps only FM/SSG. It's a start at least.
Title: Re: OPN/OPNA Decompiler Wanted
Post by: Romantique Tp on April 04, 2015, 06:03:22 PM
What are you planning to use this for?
Title: Re: OPN/OPNA Decompiler Wanted
Post by: aUsernameIsFineToo on April 04, 2015, 06:12:24 PM
I think the reason TH1~5 drums can't be dumped is because they're not FM commands. They're just special commands for the OPN/A chip to play the hard-coded drum sample. If I remember correctly, generic MML doesn't have the concept of percussion tracks.

If someone wanted to, they could probably write a method to interpret the percussion commands and turn those into MML strings. Also, it's worth mentioning that TH1~5 percussion is actually easier (in my opinion) to interpret since they're not FM drums,  which are usually chip-specific.

On a somewhat different note, this is why PMD-to-MIDI conversion works very well. The only quirk is that all the instruments get converted to pianos, although that can be easily changed in any decent MIDI sequencer.
Title: Re: OPN/OPNA Decompiler Wanted
Post by: Mr. Hlaaluington on April 06, 2015, 10:50:41 PM
If someone wanted to, they could probably write a method to interpret the percussion commands and turn those into MML strings.
I can somewhat interpret the K channel judging by the hex values it produces. MML is set up like: "@128c@2c@1c" and if you were to skim through a converted song with those notes, they would appear to be almost next to each other  (I believe it is separated with some hex command or nothing at all), like "80 ... 02 ... 01". However, I haven't spent any time decoding the way it reads loops, volume, and length.
Title: Re: OPN/OPNA Decompiler Wanted
Post by: JonMan94 on October 07, 2015, 02:32:06 PM
o3o Okay I downloaded this... how to use?