Jump to: navigation, search



gamemus — read, write and convert game music files


gamemus [options...] song [actions...]


Perform the specified actions on the given song file. The actions are performed in order (i.e. the first action specified on the command line is performed first.)


--convert=format:file, -c format:file

convert the input song into another format, saving it as file. Use --list-formats to see the available output formats.

--list, -l

list all the events in the song, in text form

--list-instruments, -i

list all the instruments used in the song, in text form

--newinst=format:file, -n format:file

use a different instrument bank for subsequent conversions with --convert.

--repeat-instruments=count, -r count

repeat the instrument bank until there are count instruments available. This is useful when replacing instruments, but there are not enough of them in the newly loaded bank.



show a list of supported file formats, along with the value to pass to --type, --convert and --newinst.

--force, -f

open the file as the given --type, even if it doesn't look like it's in that format.

--force-opl2, -2

force OPL2 mode (11 channels) when writing FM songs with --convert. This drops events that enable OPL3 mode.

--force-opl3, -3

force OPL3 mode (18 channels) when writing FM songs with --convert. This duplicates certain events so they apply to both register sets, and drops events that disable OPL3 mode. This may fail if the file format does not support OPL3 chips.

--no-pitchbends, -n

don't use pitchbends with --convert. This can make the output notes a bit cleaner if the song doesn't use any pitchbends.

--script, -s

print output suitable for parsing by a script.

--type=format, -t format

manually specify the file type. The type is normally autodetected, but it needs to be specified for a few formats which lack signatures to identify them by. See --list-types.


gamemus song_5.kb1 --list

list all the note on/off and other events in the Kiloblaster theme song.

gamemus --type imf-idsoftware-duke2 hesbacka.imf -c cmf-creativelabs:out.cmf

convert the Duke Nukem II song hesbacka.imf into a CMF file saved as out.cmf. Because both IMF and CMF formats use Ad Lib/FM instruments, the instruments are converted as-is, with no replacement instrument bank required. Duke Nukem II however, plays its IMF songs at a different speed to the normal format, so the imf-idsoftware-duke2 file type must be manually specified to get the correct tempo.

gamemus capture.dro -n gm.mid -c mid-type0:out.mid

convert the DOSBox Ad Lib capture capture.dro into a MIDI file called out.mid, using the instruments loaded from gm.mid.

Replacing the instruments is required here, because MIDI files cannot use Ad Lib instruments. The first instrument encountered in capture.dro is replaced with the first instrument used in gm.mid (which may not necessarily be MIDI instrument #1/piano.)


Exit status is 0 on success, non-zero on failure (1 for bad parameters, 2 for critical errors such as being unable to open the the archive file, 3 for more information needed, 4 for non-critical errors such as being unable to insert one of many files, 5 for uncommon failures like running out of disk space.)

All the file formats supported by this utility are fully documented on the Game Modding Wiki.

Bugs and Questions

Report bugs at

Ask questions about Camoto or modding in general at the RGB Classic Games modding forum


Copyright (c) 2010-2012 Adam Nielsen.

License GPLv3+: GNU GPL version 3 or later

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.