From MIDI

This procedure allows you to create an IMF file from a source MIDI.

Create a MIDI file

This is the hard part (because you need musical talent!) Create a MIDI file in your favourite sequencer. Rosegarden is free, as is the DOS-based Voyetra Sequencer Plus Gold which was used by Bobby Prince to create the MIDIs behind many of the original IMF files. Because this method goes via CMF format which handles percussion very differently to MIDI, the source MIDI file will need to follow certain rules for its percussion. Each instrument should be on a different channel, and the pitch of the note will, like normal MIDI instruments, affect the pitch of the percussion instrument. (If you just use normal MIDI percussion where everything is on channel 10 and different notes play different instruments, it will be converted as a single instrument - say a drum - playing different notes.) The easiest way to do this is to ignore channel 10 entirely when composing your MIDI file.

The instruments you choose are unimportant as they will be overridden later.

When you have your MIDI file you must export it as a type-0 format MIDI, as MID2CMF in the next step only supports type-0 files (they only have a single track.) You will no doubt want to keep your original multi-track file in case you need to do some more work on the song later.

Special modes

The OPL is only able to play nine notes simultaneously, so the easiest way to work within this limitation is to use channels 1 through 9 in the source MIDI, and only ever play one note at a time on each channel. Because CMF files use the raw MIDI data unchanged, some special MIDI controllers can be used to adjust how the CMF file sounds. There is a full list in the CMF format article however the main one is MIDI controller 0x67 (decimal 103) which is used to enable and disable the OPL's rhythm mode. When this controller is set to 1, rhythm mode is activated. This sacrifices three instruments to gain five percussion-only instruments, for a total of 11 simultaneous notes. In this mode only channels 1 through 6 are used, and channels 12 through 16 are used for the new percussion instruments (see the CMF article for the exact instrument-to-channel assignment.) It is still possible to use program change events to change the instrument on these percussion channels, and indeed this is how different types of drum and snare sounds are produced.

MID2CMF

Download MID2CMF and convert the MIDI file into CMF format. At this point the instruments will sound bad, but as long as the song otherwise sounds good enough proceed to the next step.

Set instruments

Editing instruments in SBTimbre

Download SBTimbre and run it through DOSBox. From the File menu, import the CMF file that was created in the previous step. Once the instruments have been tweaked to perfection, export them back to the same CMF.

CMF2IMF

The CMF file should now sound perfect (e.g. if you play it in Adplug.) Download CMF2IMF and convert the CMF file into IMF format. Remember to use the correct speed and type options for the game you will be using, as shown below.