Bio Menace MIDI musics

A general chat area, here you can post anything that doesn't belong in another forum.
Post Reply
User avatar
Vorticon Elite
Posts: 1640
Joined: Sun Jan 11, 2009 15:19
Location: Hungary

Bio Menace MIDI musics

Post by szemi » Thu Jul 02, 2015 22:14

Can somebody tell me where to download the BM MIDI songs?
Yeah, piece of cake!

User avatar
VBB's Partner in Crime
Posts: 3004
Joined: Mon Jul 26, 2010 8:36

Post by Paramultart » Fri Jul 03, 2015 0:27

"Father Mabeuf was surveying his plants"

User avatar
Tool Smith
Posts: 1370
Joined: Fri Dec 12, 2008 1:21
Location: Abiathar C&C

Post by Fleexy » Fri Jul 03, 2015 16:13

Alright, I'll be figuring out how to extract these live! (Translation: I have no idea what I'm doing.) I'll perform the procedure on Bio Menace 1.

Open up the AUDIOHED file in a hex editor, I like XVI32. Each 4-byte sequence is the starting address of an audio chunk (except the last, which is the size of the AUDIO file). That $00001C5E value that gets repeated a bunch of times indicates the position of the unused "digitized" sound effect chunks. After those are the actual IMF songs. The first distinct value after that run is at address $01F8, which is 504 in decimal. Divide that by 4 to get the first IMF song chunk ID, which is 126. Since the AUDIOHED is 580 bytes long, it contains (580 / 4) - 1 = 144 chunks. (I subtracted 1 because the last entry is just there to give the ending address of the last chunk.)

Now we need to extract the IMFs. I'm not sure if KeenWave supports Bio Menace or even lets you put in manual chunk IDs, and I don't have a copy handy anyway, so we'll go with Abiathar. Use New Project (under File), choose "Start from a template", pick the Bio Menace episode (again, I'm doing episode 1), and hit Next. On "Containing Folder", browse to the folder containing your Bio Menace stuff. On "Level Source", start from existing level files. The defaults on "Level Files" are fine if you haven't renamed anything. On "Graphics Source", use EGA resources. The defaults on "Graphics Files" are fine. On "Tileinfo Source", manage tileinfo as part of the map header. On "Tileinfo File", load from the pre-existing resource. Hit Finish and you're editing Bio Menace levels in Abiathar!

Actually, it now comes to mind that opening the BM levels was a completely irrelevant detour - we could have just fiddled any old Abiathar project file to accept these audio files. Anyway, save this project in the same directory you specified in Containing Folder, then close Abiathar and break out a text editor. (Notepad will do just fine.)

Use your text editor to open ADEPS file you just created and defaults.aconf, which Abiathar creates on its first run of the New Project Wizard. In defaults.aconf, look for an AudioSettings compound that isn't set to Nothing. (The one in the Keen Dreams template, starting on line 61, is convenient.) Copy everything from the word AudioSettings to the first closing curly bracket. Paste it over the "AudioSettings: Nothing" line in your new ADEPS file. Don't bother fixing the indentation. Change the PcStart, PcEnd, AdlibStart, and AdlibEnd values to 0. For ImfStart, fill in the starting chunk number we found earlier: 126. For ImfEnd, fill in the ending number: 144. If an "AllowMappings: False" line isn't already in the AudioSettings compound, add it. Save your ADEPS file and close your text editor(s).

Reopen Abiathar, choose Open Project, and select your ADEPS file. Select Edit | Audio | Resources. Choose to "Associate existing, modified audio files." Uncheck "This game compresses its audio files." Fill in the AudioT and AudioHed fields as indicated, then click OK. Now we're ready to export these IMFs. Choose Edit | Audio | Export. If it asks to export full ripped chunks, choose Yes. In the resulting Save As dialog, create a new folder (I called mine "imf") and save the ASNDS file in it. When you save that file, Abiathar will also spew out all your audio files in the same directory. (We'll only get IMFs because we zeroed the other types of audio chunks.) If you get a message saying "Exported sounds successfully", you did everything right.

Now we need to convert those IMFs to MIDIs. For that, I suggest DRO2MIDI. (You want the download link labeled "Win32.") Extract the ZIP and move the dro2midi.exe and inst.txt files to your IMF directory. Open a command prompt and navigate to that directory. (If you're on Windows 8, shift+right-click on the file list background in Explorer and choose "Open command window here.") DRO2MIDI is invoked by passing the IMF (or DRO, as it were) as the first argument and the output file as the second. For example, typing this in the prompt will convert the first IMF to a MIDI (if you named your ASNDS file "imfs"):

Code: Select all

dro2midi imfs126.imf 126.mid
Repeat that invocation for each IMF you want to convert. (If you're really smart/lazy, you could probably write a batch file.) For your convenience, here's a ZIP file of all the Bio Menace 1 MIDIs, plus the original IMFs for good measure.

Extracting the songs for episodes 2 and 3 is left as an exercise to the reader.

Post Reply