IMF tools (as if we didn't have enough of them)

Here is where to post about the latest Commander Keen fangame or modification you've finished, a new website you've made, or another Keen-related creation.
Keening_Product
Kuliwho?
Posts: 2122
Joined: Fri Jan 20, 2012 7:02
Location: Tied up in the Oracle Chamber's basement
Contact:

Post by Keening_Product »

I agree with the two comments above - that's a very typical reaction for a 64-bit system.

If command line doesn't work then try it in DOSBox.
Keening_Product was defeated before the game.

"Wise words. One day I may even understand what they mean." - Levellass

User avatar
TerminILL
Skypest
Posts: 589
Joined: Fri Oct 23, 2009 8:59
Location: In a box.
Contact:

Post by TerminILL »

The tools beside the player are Win32 programs. They have no issue on 64-bit systems, and won't run in DOSBox at all. I suspect Levack simply doesn't know how to use them - there's no graphical interface, but you don't need the commandline for basic usage, dragging and dropping the involved files onto the EXE.

The tools are great, while I don't have extensive experience with these things, the MIDI to IMF converter produced reliably better results than IMF Creator's untweaked output with the few, fairly complex MIDIs I tried.
Shonikado wrote:Looking back on what we've done and wanting to change it is the first step in becoming a weakling that cannot do anything.

User avatar
_mr_m_
Vortimaestro
Posts: 424
Joined: Mon May 11, 2009 23:14
Location: A Midwest cornfield

Post by _mr_m_ »

T-Squared wrote:I would suggest using IMF Creator instead, because it has IMF formats for Wolfenstein 3D, Duke Nukem II, and... shoot, there's one more that I can't remember.

You can:
*make custom instruments and save them to an OPL file.
*set the proper music speed (in Hz)
*even LISTEN to the music file before you export it! (However, this is a bit of a snag, as the music instruments can sound different in-game.)
all from within the program!
This is true but unless you have a solid understanding of how to create custom patches for instruments -- and even then, as you pointed out, they may not sound the same in-game.

I've found that K1n9 Duke's IMF creator results in a what-you-hear-is-what-you-get song.

Although I wonder if you can alter the OPL patches in the source code or maybe the MAME code that was used...I can't say much more because there is no source available.
"I just drew this stupid little fish." -- Tom Hall

User avatar
Gridlock
Vorticon Elite
Posts: 565
Joined: Thu Aug 12, 2010 2:20

Post by Gridlock »

Using the -chunk option, I was indeed able to get imfs created in this program to play in Keen 4. Very awesome. I noticed these imf files sound nearly identical in-game to when they're played with another program, IMFPlayerWin32. I haven't actually gotten K1n9_Duk3's imf player to work yet, though I'm probably just not using the correct batch file commands or something. This level of accuracy is quite nice.
Image
Armageddon Begins Again. The Alphamatic has arrived.

Atroxian Realm: viewtopic.php?f=4&t=3536
The Alphamatic: viewtopic.php?f=4&t=4086

User avatar
K1n9_Duk3
Vorticon Elite
Posts: 628
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Post by K1n9_Duk3 »

Levellass wrote:Also, could you put an IMF file option in? I'd like to be able to scan an existing IMF file and remove all the dummy commands; I have noticed that the converter does this very well, but I don't always like how it converts midis and would like to modify existing IMF files. I assume this should be trivial to add.
You can use K1n9_Duk3's IMF crusher to do that. It also allows you to convert IMF rates and convert files from plain IMF (Type 0) to AudioT chunks (Type 1). GPL'ed source code is included.
T-Squared wrote:I would suggest using IMF Creator instead, because it has IMF formats for Wolfenstein 3D, Duke Nukem II, and... shoot, there's one more that I can't remember.

You can:
*make custom instruments and save them to an OPL file.
*set the proper music speed (in Hz)
*even LISTEN to the music file before you export it! (However, this is a bit of a snag, as the music instruments can sound different in-game.)
all from within the program!
As I wrote in my first post, I didn't check for other IMF tools before writing my own tools. The only IMF converter I knew was Dark One's MUS2IMF (which didn't work correctly most of the time).

I might create a custom instrument file for IMF Creator someday, based on the Timbre file used in my MID2IMF tool.
Gridlock wrote:I haven't actually gotten K1n9_Duk3's imf player to work yet, though I'm probably just not using the correct batch file commands or something.
It is a DOS program. You'll probably only get it to run in DOSBox. This is one way to use it:

1. Put my IMFPLAY.EXE and your IMF files into the same folder.
2. Drag IMFPLAY.EXE onto your DOSBOX.EXE. This will start DOSBox and run IMFPLAY.EXE in DOSBox, putting out the default help text.
3. Type "imfplay song.imf" and press enter to play "song.imf" (just an examlpe).

Note: Gerstrongs IMF Player (a.k.a. IMFPlayerWin32) had a bug that would cause the player to crash when playing IMF files that use rhythm mode (only used by some of Moster Bash's IMF files). You can find an updated version of the IMF Player here:
http://k1n9duk3.k1.ohost.de/files/imfpl ... 32_v21.zip (Source Code: http://k1n9duk3.k1.ohost.de/files/imfplayer_v21_src.zip)
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net

User avatar
Levellass
S-Triazine
Posts: 5261
Joined: Tue Sep 23, 2008 6:40

Post by Levellass »

Most excellent, in many modding situations every byte counts and this has helped reduce memory errors significantly.
What you really need, not what you think you ought to want.

User avatar
Gridlock
Vorticon Elite
Posts: 565
Joined: Thu Aug 12, 2010 2:20

Post by Gridlock »

Hold on, did you say this IMF crusher can reduce the size of an imf file? Because that would be immensely helpful.
Image
Armageddon Begins Again. The Alphamatic has arrived.

Atroxian Realm: viewtopic.php?f=4&t=3536
The Alphamatic: viewtopic.php?f=4&t=4086

User avatar
MoffD
Vorticon Elite
Posts: 1204
Joined: Thu Jul 05, 2012 17:30
Location: /dev/null
Contact:

Post by MoffD »

Thanks for the imf2wav, Now I have mp3's of all of the keen songs for my music player ;)
mortimermcmirestinks wrote: Now I wish MoffD wasn't allergic to me.
Levellass wrote:You're an evil man.
Image

Keening_Product
Kuliwho?
Posts: 2122
Joined: Fri Jan 20, 2012 7:02
Location: Tied up in the Oracle Chamber's basement
Contact:

Post by Keening_Product »

MoffD wrote:Thanks for the imf2wav, Now I have mp3's of all of the keen songs for my music player ;)
Oh, the compression, it burns!
Keening_Product was defeated before the game.

"Wise words. One day I may even understand what they mean." - Levellass

User avatar
Levellass
S-Triazine
Posts: 5261
Joined: Tue Sep 23, 2008 6:40

Post by Levellass »

Sir, you want to get yourself a good compressor. Wave files are nice, but terrible space hogs.
What you really need, not what you think you ought to want.

User avatar
MoffD
Vorticon Elite
Posts: 1204
Joined: Thu Jul 05, 2012 17:30
Location: /dev/null
Contact:

Post by MoffD »

Keening_Product wrote:
MoffD wrote:Thanks for the imf2wav, Now I have mp3's of all of the keen songs for my music player ;)
Oh, the compression, it burns!
Heh, I think they sound fine compressed. I just don't have much space on my player for wav files :D

and it's better than midi files
mortimermcmirestinks wrote: Now I wish MoffD wasn't allergic to me.
Levellass wrote:You're an evil man.
Image

User avatar
K1n9_Duk3
Vorticon Elite
Posts: 628
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Post by K1n9_Duk3 »

_mr_m_ wrote:Although I wonder if you can alter the OPL patches in the source code or maybe the MAME code that was used...I can't say much more because there is no source available.
MID2IMF doesn't use any MAME code. All it does is parsing MIDI files and converting the MIDI commands into register/value pairs that can be sent to an OPL chip to play the MIDI song.

You can alter the OPL patches (the timbre file), and you don't even need to alter the source code for that. The timbre file is included in the executable and can be exported using the /dumptimbre option. You can then edit the timbre file (using a hex editor) and tell the converter to use your custom timbre file by passing the /timbre=<file> option.

I know that using a hex editor for this isn't very comfortable, but that's just how it is. I recommend using this page on the ModdingWiki and this text file to learn what the values in the timbre file do. For the first eleven bytes of a timbre file, you can simply copy the first eleven bytes of any standard sound blaster instrument data. The values for Transpose and Velocity are not part of the standard sound blaster instrument data, so you might have to use trial and error to find the best values for them.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net

User avatar
thehackercat
Yorp Doctor
Posts: 665
Joined: Fri Aug 14, 2009 0:05

Post by thehackercat »

Bump.

I've got an IMF issue, and this seems like the thread in which to ask about it.

The volume of my IMF files is very low. Even with "quiet adlib sounds" enabled, the music is pretty hard to hear over the sound effects. I'm using K1n9_Duk3's mid2imf program and also IMFCRUSH.

I have not tampered with the "-VOLUME" switch or anything like that, and the key velocities within the MIDIs are all at default! I don't know what's going on! Can anyone tell me how to get these IMFs to a higher volume?

Thanks.

User avatar
K1n9_Duk3
Vorticon Elite
Posts: 628
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Post by K1n9_Duk3 »

I've had similar problems with some MIDI files and I haven't found a good way to solve this issue. The default volume for mid2imf is already set to the maximum, so you cannot get a higher volume with that. Try using different instruments or raising the overall volume in your MIDI file (each instrument has its own volume setting in the mid2imf timbre file).

One thing you could try is using IMFCreator to convert your MIDI song to IMF. This might create an IMF file with higher volume.

Another solution would be to create a customized timbre file for midi2imf, but that's not really an easy task.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net

User avatar
_mr_m_
Vortimaestro
Posts: 424
Joined: Mon May 11, 2009 23:14
Location: A Midwest cornfield

Post by _mr_m_ »

K1n9_Duk3 wrote:
Another solution would be to create a customized timbre file for midi2imf, but that's not really an easy task.
Challenge accepted.
"I just drew this stupid little fish." -- Tom Hall

Post Reply