Converting IMF files

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Converting IMF files

Post by Ed the Bat »

I've got a set of IMF tracks that I can't work with. Even among all of the tools I have that can play the IMF format (ZDoom, my Wolf3D editor, even Winamp AdPlug), I've got nothing that actually makes music out of these. I tried converting them using some of the techniques on the ZDoom wiki, but saw no success. The only program I've seen so far that can play these songs is the game they came from.

Am I overlooking something here? It's not unusual that there's a method or tool that I've overlooked.

And if it would be useful to solving this, the game these came from, the only program they seem to play in, is Super 3D Noah's Ark. Yep.=3
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: Converting IMF files

Post by Kinsie »

Is the problem that it won't play in ZDoom? Or that it won't play in anything?

If it's the former, you need to use a command in the SLADE3 console to add a IMF header.

If it's the latter, you might just have a shitty file.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Converting IMF files

Post by Gez »

It's possible that they aren't in the same format as the Wolf3D IMF.
VGMPF Wiki wrote:The type-0 MIDI files were ripped from the AudioHed.N3D and AudioT.N3D files using Adam Biser's Wolf Data Compiler. They were recorded using Winamp's MIDI plugin v3.17. Unlike all other games that use the Wolfenstein engine, Super Noah's Ark 3D does not use IMF music. Instead, the developers added their own code to play general MIDI through AdLib. Because of this, the sound of the recording isn't 100% accurate, and should be updated when a suitable AdLib MIDI rendering is made.
So, it seems like they're actually plain old MIDI files.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Converting IMF files

Post by Ed the Bat »

Kins: I said I tried the methods on the wiki and they proved fruitless. They play perfectly fine in their own game, so I'm not thinking there's anything wrong with the files. But no other program or game can play them.

Gez: Looks like you're onto something. Strange that I missed that one, since I visit the VGMPF. Anyhow, changing the file extension from .IMF to .MIDI gets them to play (using the MIDI device, obviously). The tempo is different, but I'm noticing that to be the case in a lot of IMF files when played outside of their native games... then again, this one may be my imagination, unlike Commander Keen (I KNOW these play faster out-of-game than they did in-game...)

Followup: Ok, now that I know these are apparently MIDI, I can play them happily in my media player, but this must be a unique variant of MIDI, since SLADE3, Audacity, and ZDoom fail to recognize it. This means that I would need to find some other method if I wanted to borrow them for a project, for instance...
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Converting IMF files

Post by Gez »

Ed the Bat wrote:Followup: Ok, now that I know these are apparently MIDI, I can play them happily in my media player, but this must be a unique variant of MIDI, since SLADE3, Audacity, and ZDoom fail to recognize it. This means that I would need to find some other method if I wanted to borrow them for a project, for instance...
Bundle them and attach them here, and I'll take a look at it. I suspect they must simply have some extra header which throws off the format analysis code. I've already seen that with, for example, the GMID format used in Dark Forces and other old Lucas Arts titles.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Converting IMF files

Post by Ed the Bat »

Here they are. What you said sounds reasonable enough to me, but the internals of MIDI are a good distance over my head. Anything you can uncover from these would be great to learn, though. Thanks!
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Converting IMF files

Post by Gez »

The first two bytes seem to be a size value. Just look:

name size value
noah01 3324 3234
noah02 3101 3011
noah03 2849 2759
noah04 3069 2979
noah05 3218 3128
noah06 3728 3638
noah07 4104 4014
noah08 3942 3852
noah09 4023 3933
noah10 3113 3023
noah11 4632 4542

As you can see, the value is always 90 less than the file size.

And what is there after these two bytes that indicate a size? Mthd. The proper beginning of a MIDI file. If you just delete the first two bytes in a hex editor, it should load okay in everything that plays MIDI.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Converting IMF files

Post by Ed the Bat »

Beautiful! Thank you SO much. I never would have figured this out on my own.
Locked

Return to “Editing (Archive)”