Quasar
Moderator

Posts: 4613
Registered: 08-00 |
It was always assumed during the earlier days of DOOM editing that you could not put MIDIs directly into WADs. I tried looking up information on the DMX sound library to see when MIDI support might have been added to it, but it's so old and out of date that apparently there is no info about it on the net any more. Please remember that id did NOT write the sound code that is in DOOM -- it is part of the DOS sound library called DMX. This is what DOOM's original music starting function looks like, courtesy of Raven:
code: void I_PlaySong(int handle, boolean looping)
{
int rc;
rc = MUS_ChainSong(handle, looping ? handle : -1);
#ifdef SNDDEBUG
if (rc < 0) printf("MUS_ChainSong() returned %d\n", rc);
#endif
rc = MUS_PlaySong(handle, snd_MusicVolume);
#ifdef SNDDEBUG
if (rc < 0) printf("MUS_PlaySong() returned %d\n", rc);
#endif
}
As you can see, there is no checking of the format or explicit mention of MIDI or MUS. It just calls the DMX library's MUS_PlaySong function, which after a certain version of DOOM must have added some crude auto-detected MIDI support.
No other existing libraries support the obsolete MUS format. It was created as a convenience for 16-bit DOS programs (hence the use of 16-bit offsets and 64k segment limits). Modern source ports like Eternity do not "add" MIDI support at all. Rather, we have to "add" MUS support by explicitly putting MUS -> MIDI converters into the program. Native MIDI support is easy; Windows and other OSes do that automatically. MUS has to be converted into the corresponding MIDI messages, on the other hand, which is not a trivial process.
BTW, as far as I know, id did not release MUS2MIDI or MIDI2MUS. Those were, like all other DOOM editor utilities with the one exception of idbsp, user-made programs. Let's not give id credit for what the community had to accomplish...
|