Not at all, or just sounds bad?jallamann wrote:Sadly, IMF2MID doesn't work on the Major Stryker IMFs
Imf support?
Moderator: GZDoom Developers
Mostly because id Software doesn't want to make Keen games, and the person that wants to make Keen games, Tom Hall, is no longer at id. As long as id has the copyright/trademark, Tom Hall is unable to do anything, unless id allows him to do it.Enjay wrote:(Hmmm, I wonder why there was never a Keen 3D?)
Not at all. It outputs a MIDI file that has a 1 second duration with no notes or instruments.Ajapted wrote:Not at all, or just sounds bad?
Did it, now that I know IMF is little more than a raw dump of OPL commands. Adding support for it was very easy, since I already had code to handle RDosPlay's RAW files. IMFs are essentially a more limited version of the same thing.
However, there are actually three IMF formats. I have chosen to support only one of them: The type with a header, so it can actually be identified automatically. If you have a hex editor, converting from the other two formats is extremely simple:
For this song, the first 32 bytes are:
00 00 00 00 BD 00 00 00 08 00 00 00 20 00 00 00
23 00 00 00 40 0B 00 00 43 00 00 00 60 A8 00 00
This is headerless, so we need to convert it using steps 2 and 3 above.
Step 2. The first two bytes of this file are both zero, so add four more zero bytes to the start of the file. The first 32 bytes of the file now look like this:
00 00 00 00 00 00 00 00 BD 00 00 00 08 00 00 00
20 00 00 00 23 00 00 00 40 0B 00 00 43 00 00 00
Step 3. Insert nine bytes at the start of the file. The first 32 bytes of the file now look like this:
41 44 4C 49 42 01 00 00 01 00 00 00 00 00 00 00
00 BD 00 00 00 08 00 00 00 20 00 00 00 23 00 00
This song has now been converted to the IMF-with-header format. It has grown thirteen bytes in size.
Here is another example from a different song (titlermx.imf).
This time, the first 32 bytes are:
90 2F 00 00 00 00 01 00 00 00 02 00 00 00 03 00
00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00
Step 2. The first two bytes are not both zero, so insert two zero bytes after them. The first 32 bytes of the file now look like this:
90 2F 00 00 00 00 00 00 01 00 00 00 02 00 00 00
03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00
Step 3. Add the nine header bytes to the start of the file, which leaves the first 32 bytes looking like this:
41 44 4c 49 42 01 00 00 01 90 2f 00 00 00 00 00
00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00
This file is now also in IMF-with-header format. Unlike the first example, it has grown only eleven bytes because we only needed to insert two zero bytes for step 2.
However, there are actually three IMF formats. I have chosen to support only one of them: The type with a header, so it can actually be identified automatically. If you have a hex editor, converting from the other two formats is extremely simple:
- If your file starts with the five letters "ADLIB", you don't need to do anything. It already has the header.
- If either of the first two bytes of the file are non-zero, insert two zero bytes after the first two bytes. Otherwise, add four zero bytes at the start of the file.
- At the start of the file, insert the following nine bytes (in hexadecimal): 41 44 4C 49 42 01 00 00 01
- If you did steps 2 and 3 correctly, your file should now be eleven or thirteen bytes larger than it was before.
For this song, the first 32 bytes are:
00 00 00 00 BD 00 00 00 08 00 00 00 20 00 00 00
23 00 00 00 40 0B 00 00 43 00 00 00 60 A8 00 00
This is headerless, so we need to convert it using steps 2 and 3 above.
Step 2. The first two bytes of this file are both zero, so add four more zero bytes to the start of the file. The first 32 bytes of the file now look like this:
00 00 00 00 00 00 00 00 BD 00 00 00 08 00 00 00
20 00 00 00 23 00 00 00 40 0B 00 00 43 00 00 00
Step 3. Insert nine bytes at the start of the file. The first 32 bytes of the file now look like this:
41 44 4C 49 42 01 00 00 01 00 00 00 00 00 00 00
00 BD 00 00 00 08 00 00 00 20 00 00 00 23 00 00
This song has now been converted to the IMF-with-header format. It has grown thirteen bytes in size.
Here is another example from a different song (titlermx.imf).
This time, the first 32 bytes are:
90 2F 00 00 00 00 01 00 00 00 02 00 00 00 03 00
00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00
Step 2. The first two bytes are not both zero, so insert two zero bytes after them. The first 32 bytes of the file now look like this:
90 2F 00 00 00 00 00 00 01 00 00 00 02 00 00 00
03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00
Step 3. Add the nine header bytes to the start of the file, which leaves the first 32 bytes looking like this:
41 44 4c 49 42 01 00 00 01 90 2f 00 00 00 00 00
00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00
This file is now also in IMF-with-header format. Unlike the first example, it has grown only eleven bytes because we only needed to insert two zero bytes for step 2.
Last edited by randi on Mon Sep 19, 2005 6:48 pm, edited 1 time in total.
- MartinHowe
- Posts: 2067
- Joined: Mon Aug 11, 2003 1:50 pm
- Preferred Pronouns: He/Him
- Location: East Suffolk (UK)
- Shadelight
- Posts: 5113
- Joined: Fri May 20, 2005 11:16 am
- Location: Labrynna
-
- Posts: 380
- Joined: Thu Oct 21, 2004 5:27 pm
- MartinHowe
- Posts: 2067
- Joined: Mon Aug 11, 2003 1:50 pm
- Preferred Pronouns: He/Him
- Location: East Suffolk (UK)
Heh. Do we know if he's even humanAFADoomer wrote:I wouldn't go THAT far...MartinHowe wrote:Has AFADoomer offered to have your babies yet?
Though we never really established if randy was male or female...

Joking apart, every wolf TC I've ever seen has been let down by the music, because only some of the original MIDIs were available (from BP's web site), others had to be replaced or approximated, and even the IMF extractor and player had lots of limitations. I imagine that for wolf TC authors such as yourself, IMF support based on actually emulating the adlib hardware could be very cool...