Imf support?

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Imf support?

by jallamann » Wed Sep 21, 2005 6:23 am

You know that it's far easier to make a MIDI sound the way you want it to, compared to IMF's, right? If it sounds bad, it's easy to change instruments so that it'll sound better.

by AFADoomer » Wed Sep 21, 2005 5:03 am

Very true. I was only able to find a few of the original MIDIs, and the IMF2MID program conversions sucked.

by MartinHowe » Wed Sep 21, 2005 3:44 am

AFADoomer wrote:
MartinHowe wrote:Has AFADoomer offered to have your babies yet? :D
I wouldn't go THAT far...

Though we never really established if randy was male or female...
Heh. Do we know if he's even human :)

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...

by AFADoomer » Tue Sep 20, 2005 4:14 pm

MartinHowe wrote:Has AFADoomer offered to have your babies yet? :D
I wouldn't go THAT far...

Though we never really established if randy was male or female...

by Cptschrodinger » Tue Sep 20, 2005 9:13 am

Uhh... King... You said you were gonna stop that shit.

by TheDarkArchon » Tue Sep 20, 2005 7:37 am

WTF?!?!

by Shadelight » Tue Sep 20, 2005 6:59 am

if you people get too excited he might take it out ;)

by jallamann » Tue Sep 20, 2005 6:29 am

Maybe I've done something wrong, but I tried editing one of the Major Stryker IMF's, but now it plays at like 150% speed and is over twice the total lenght, but only silence after the last note :?

by MartinHowe » Tue Sep 20, 2005 3:33 am

randy wrote: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.
Has AFADoomer offered to have your babies yet? :D

by jallamann » Tue Sep 20, 2005 2:11 am

:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D

by Cptschrodinger » Mon Sep 19, 2005 9:15 pm

O.O It got in?!?!??!

by Bashe » Mon Sep 19, 2005 6:32 pm

Cool. Now we can have the original Wolf3d and Blake music in mods for those games!

by randi » Mon Sep 19, 2005 6:00 pm

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:
  1. If your file starts with the five letters "ADLIB", you don't need to do anything. It already has the header.
  2. 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.
  3. At the start of the file, insert the following nine bytes (in hexadecimal): 41 44 4C 49 42 01 00 00 01
  4. If you did steps 2 and 3 correctly, your file should now be eleven or thirteen bytes larger than it was before.
Example, from a Corridor 7 song.

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.

by Ajapted » Fri Sep 09, 2005 10:29 am

There are apparently two slightly different IMF formats, but IMF2MIDI only handles one, so that may explain it.

by jallamann » Fri Sep 09, 2005 10:25 am

Enjay wrote:(Hmmm, I wonder why there was never a Keen 3D?)
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.
Ajapted wrote:Not at all, or just sounds bad?
Not at all. It outputs a MIDI file that has a 1 second duration with no notes or instruments.

Top