Skip to content

Valley Bell's MIDI converters

game music -> mid

Technical discussion which is not directly related to VGM files. Talk about Hardware and Software.

Moderator: Staff

  • kingcandy Offline
  • Posts: 51
  • Joined: 2019-04-13, 15:38:34

Post by kingcandy »

hay vally bell, your sps unpacker works great with the 3 games I tested. I only did the ones you personally tested, because there I know what files to use to get just the sc55 compatible midis, the fm ones probably won't play well in modurn soundfonts.
ever plan onadding the varient used in nemesis 90kai? it uses 3 different file extentions for the music, 1 for each module. music.fm for internal fm, music.mt for roland mt32/cm64, and music.gs is for roland gs (sc55).
also, ever plan on doing something similar for the magical company format? Magical Company is the studio responsible for the x68000 ports of some neo geo games. these games have sc55 music support. also do an extractor for star luster on x68000. and also the konami x68000 driver (for castlevania x68, of course)
be a hero and stop coppa now!
http://chng.it/DNc2L8LvLJ
  • User avatar
  • ValleyBell Offline
  • Posts: 4810
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

The converter may work for other S.P.S. games, but you may need to play with the parameters.
The file extension is usually irrelevant/arbitrary.

I'm currently staying away from the Konami sound driver due to its complexity. (I only looked at the MegaDrive variant so far.)

As shown by the X68000 Music Drivers wiki page, games by Magical Company often use the ZmuSiC sound driver, which I already have a converter for.
The converter usually breaks on FM data though and works with v1 and v2 only. (ZmuSiC v3 uses a different binary format.)

When games compress their data, it is often a good idea to look for the respective Hoot packs. Those usually contain decompressed song data.

modified HMI2MID.bas

Post by RandomName »

As mentioned in the chatbox, the process I do is convert the hmp to mid with modded hmi2mid.bas. Then I use a batch file using programs mf2txp/t2mfxp to remove controllers 108/109 and modify controllers 110/111 to v=0.

The format from lemmings chronicles is strange and the only other game like it is Silverload so the instrument designators are not processed correctly currently.

Then to check the conversion, I use the official mid2hmp.exe that was released to the Descent community and in about 85% cases I get back a bit identical copy of the original hmp. The wildcard handling of mid2hmp is defective so a batch file should be used instead. And the other hmp that aren't identical to the original are usually a couple bytes different.

The newer HMP used in games like Slipstream 5000 have more controllers but without the corresponding mid2hmp I didn't investigate those controllers. The game Constructor included the last HMI format mid2hmi.exe so I plan to play with that in the future.

The instrument designators can't be used exclusively to determine which tracks are for which audio devices however. Because in many cases audio files that are meant for FM cards such as Descent HMQ, or SSF2T files ending in _F, often times have all their tracks labelled with all designators.

Tools/references used

MIDI2HMP

SOS40.zip - HMI specs for newest format but also pertains to older format

MF2T and T2MF

SED for Windows

Here is what I found on the instrument designators on the Descent HMP format

31 tracks (excluding timing track) * 20 bytes each = total of 620 bytes, starting at offset 0x90.

Each track is 20 bytes separated into 5 longs.

The first long of each track is always 00000000. The next 4 longs could be from the following:

0xA000 = General MIDI
0xA002 = FM OPL2/OPL3
0xA003 = Callback
0xA004 = Roland MT-32
0xA005 = Digital MIDI samples
0xA006 = Internal Speaker
0xA007 = Software Wavetable
0xA00A = Ultrasound

The abbreviations of the tracks are:
General MIDI = G
FM OPL2/OPL3 = F
Callback = C
Roland MT-32 = M
Digital MIDI = D
Internal Speaker = I
Software Wavetable = W
Ultrasound = U

I'm unable to attach the .bas I modified from HMI2MID.bas because the message board will not accept it.

modified HMI2MID.bas

Post by RandomName »

I attached the bas and batch file.
Attachments
fixHM2MID.txt
The batch file I use afterwards to finish
(557 Bytes) Downloaded 333 times
hmp2mid.txt
Modified bas.
(10.32 KiB) Downloaded 339 times
  • User avatar
  • ArcadeTV Offline
  • Posts: 6
  • Joined: 2020-04-01, 12:40:57
  • Location: DE
  • Contact:

Post by ArcadeTV »

I'd love a compiled windows executable for konami2mid

Can anybody help me out with that?
Thanks a ton!

edit:
someone nice helped me out, here's the executable in case someone else needs it:
https://tmpfiles.org/8398/konami2mid.exe

Right now I'm struggeling with the arguments to pass while trying to convert some TMNT-HH music to midi.

Post by Stinky-sunblock »

Hi,
I've never really compiled anything before, and am trying to compile hum2mid.c. Can anyone out there help me, please?
  • Dekyo-NO Offline
  • Posts: 100
  • Joined: 2017-11-02, 3:58:27

Post by Dekyo-NO »

I've compiled it.
Attachments
hum2mid.zip
(100.9 KiB) Downloaded 282 times

Post by MixerProductions »

ArcadeTV wrote:I'd love a compiled windows executable for konami2mid

Can anybody help me out with that?
Thanks a ton!

edit:
someone nice helped me out, here's the executable in case someone else needs it:
https://tmpfiles.org/8398/konami2mid.exe

Right now I'm struggeling with the arguments to pass while trying to convert some TMNT-HH music to midi.
Hi, Any chance for a re-upload of this comp? The link is broken now
  • Dekyo-NO Offline
  • Posts: 100
  • Joined: 2017-11-02, 3:58:27

Post by Dekyo-NO »

Here's konami2mid. It's a CLI app, so you need to be somewhat familiarized with general command line software and the way the arguments (or options) work.
Attachments
konami2mid.zip
(111.31 KiB) Downloaded 317 times

Post by MixerProductions »

Sorry to be a pain, I've managed to navigate my way around it for the most part, but I am met with this error message every time "Error opening file!"

Am I using the wrong syntax maybe? "konami2mid.exe -mus Teenage Mutant Hero Turtles - The Hyperstone Heist (E).bin" should work right?
Attachments
Konami2MID error message
Konami2MID error message
Screenshot 2021-07-17 104106.png (5.92 KiB) Viewed 7320 times
  • Tom Offline
  • Ragequit Member
    Ragequit Member
  • Posts: 496
  • Joined: 2011-11-30, 17:26:44
  • Location: Italy
  • Contact:

Post by Tom »

If there are spaces in the filename, you should enclose it in double quotes, e.g.:

Code: Select all

C:\>something.exe "this is a filename.bin"
Alternatively, you can retrieve the SFN:

Code: Select all

C:\>something.exe thisis~1.bin
Also known as nineko.
  • Joey_Smith Offline
  • Posts: 3
  • Joined: 2022-09-04, 14:36:23

Post by Joey_Smith »

ValleyBell wrote:I guess it's a good idea to post some tools that I worked on (sort of) recently.
  • - Wolf Team MegaDrive -> MIDI converter (also works with raw decompressed X68000 FM/PCM songs)
  • - Tales of Phantasia/Star Ocean SPC to MIDI converter
  • - PC-98 Twinkle Soft -> MIDI converter (only tested with Bunretsu Shugo Shin Twinkle Star so far)
  • - PC-98 Twinkle Soft Decompressor (unpacks the game archives)
  • - F.M.P -> MIDI converter (tested with V.G. 1/2, Briganty, might throw "unknown command" errors on other games)
  • - X68000 S.P.S. Archive Unpacker (tested with Daimakaimura, Street Fighter II: CE and Super Street Fighter II: TNC)
I have a question about x68k_sps_dec, Should I drag and drop (SSF2) BLK files on the "x68k_sps_dec.exe" to extract the MIDis?
  • User avatar
  • ValleyBell Offline
  • Posts: 4810
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Nope, it is a command line tool where drag-and-drop does not work.
Just run it once without parameters and it will tell you what parameters it wants.
  • Joey_Smith Offline
  • Posts: 3
  • Joined: 2022-09-04, 14:36:23

Post by Joey_Smith »

ValleyBell wrote:Nope, it is a command line tool where drag-and-drop does not work.
Just run it once without parameters and it will tell you what parameters it wants.
Got it working but is this command below correct? because it's not doing anything.
g:\Backup\ADX\x68k_sps_dec.exe -2 Gm.blk output.bin
X68000 S.P.S. Archive Unpacker
------------------------------
Archive format: BLK
  • User avatar
  • ValleyBell Offline
  • Posts: 4810
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Works fine here.

Code: Select all

R:\SuperStreetFighter>x68k_sps_dec.exe -2 GM.BLK output.mid
X68000 S.P.S. Archive Unpacker
------------------------------
Archive format: BLK
Compression: LZSS-SPS v2
file 1 / 63
file 2 / 63
[...]
It even works with autodetection:

Code: Select all

R:\SuperStreetFighter>x68k_sps_dec.exe GM.BLK output.mid
X68000 S.P.S. Archive Unpacker
------------------------------
Archive format: BLK
Compression: LZSS-SPS v2
file 1 / 63
file 2 / 63
[...]
EDIT: My GM.BLK file is 162 183 bytes, FM.BLK is 151 270 bytes. I extracted them from "Super Street Fighter II - The New Challengers.hdf".
Post Reply