Table of Contents

stub update cleanup

This article is about using custom music resources with doomsday.

How do I Use External Music (MP3, CD etc…)?

Doomsday can play various external music files using the FMOD library. FMOD supports many music file formats including MP3, OGG, MOD and S3M (mods are a good choice due to their good quality/size ratio). External music files can be played at any time using the playext console command.

NOTE On some systems, using FMOD with Doomsday has caused lock-ups or other unwanted behavior. If this appears to be the case for you, you should disable FMOD with the “-nofmod” option. However, this will also make it impossible to play external music files such as MP3s.

Like other external resources, placing a music file into the Music resource class directory is enough. The file name must match the lump name of the original music data lump. For example, to replace the music for Doom's first episode's second map, the file d_e1m2.mp3 would be placed in the Music directory.

It is also possible to store music files into a WAD. Again, you must name the lumps so that they match the lumps of the original songs, and are thus loaded instead of them. Any music files supported by FMOD can be loaded from a WAD.

Another way to specify an external resource file is to use the “Ext” key of a Music definition (in Audio.ded). An example of editing the definitions: You have a terrific song called song.mp3 and you'd like to hear it instead of Doom's regular “e1m2”.

Adding Music: Step 1

The first thing to decide is whether you want to play the song from where it's currently located, or do you want to move it under the Doomsday directory. In the latter case it would be easy to distribute the song and its definition file to others, since they wouldn't have to worry about where the music file is. If you decide to move the song, create a directory under the Doomsday\Data\jDoom\ directory called Music. Another logical choice could be Doomsday\Music\. Then copy the song into the created directory.

Adding Music Step 2

Open Audio.ded in a text editor. In it, you will find a bunch of music definitions, including:

Music { ID = "e1m2"; Lump = "D_E1M2"; }

In order to make the change persist over version upgrades (each one will overwrite Audio.ded) copy the definition to User.ded in the Defs\jDoom\ directory, or create a new DED file with any name you like in the Defs\jDoom\Auto\ directory. Everything in the Auto directory will be read automatically. If User.ded doesn't exist, just create a new file for it.

Adding Music Step 3

Now you have the new music definition, and the only thing left is to let the engine know which file it should load when the song “e1m2” is played. Edit your definition by adding the “Ext” key:

Music {
  ID = "e1m2"; Lump = "D_E1M2";
  Ext = "Data\jDoom\Music\song.mp3";
}

CD tracks can be associated with songs in a similar fashion, but instead of using the “Ext” key you should use a “CD track” key:

CD track = 3;