VOGONS


OPL music in DOOM II

Topic actions

First post, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

In reference to comments made in this thread: List of fretures in the upcoming version.

The MAP12 music in DOOM II (the MUS resource inside the DOOM2.WAD file is D_THEDA2) sounds strange with DOSBox's OPL emulation, but I don't remember how it should sound because I had a WaveBlaster back in the day. The bass line and cymbal hits seem odd, and changing the oplemu and oplmode settings doesn't appear to make a difference. To better demonstrate, I'm attaching some audio files for comparison.

A .DRO recording made with DOSBox and then played with the AdPlug plugin for WinAmp sounds about the same, so it would seem that: 1) there is a common issue with OPL emulators, 2) DOSBox is somehow not playing/recording correct OPL data, 3) DOOM II does a somewhat poor job interpreting its MUS data for OPL.

Also discovered something interesting: using a WAD tool to create a PWAD (patch WAD) of the GENMIDI resource from DOOM and loading it into DOOM II, the bass line for the MAP12 music sounds a lot better to my ears, but the cymbal hits are still rather harsh.

Note: to level warp in DOOM II, you can use the IDCLEVxx cheat code with the level/map number.

Reply 1 of 17, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

played with the AdPlug plugin for WinAmp sounds about the same

AdPlug uses the old lgpl'd mame code so that should sound at least similar indeed.

Maybe you can post the dro so somebody can check if playing back the dro
on a real system is any different from playing that doom2 level on the real thing,
if it is then it's a "simple" timing issue in that they are using exact waveform
positions for the special sound.

Reply 2 of 17, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

OK, here's a capture of MAP12 made by starting up with "DOOM2 -warp 12" to get the level music by itself, ending when it starts to loop.

Reply 3 of 17, by leileilol

User metadata
Rank l33t++
Rank
l33t++

Use oplrate = 49716, that'll definitely affect your cymbals (which sounds like oplrate = 44100 from your recording). Why this isn't default, I do not know.

Someone here will use a YMF262-equipped device to record that segment sooner or later. If not then I will.

apsosig.png
long live PCem

Reply 5 of 17, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Why this isn't default, I do not know.

Several sound cards had problems with even 22050 so doubt this will get much love.

Reply 6 of 17, by leileilol

User metadata
Rank l33t++
Rank
l33t++
wd wrote:

Why this isn't default, I do not know.

Several sound cards had problems with even 22050

With oplrate? I don't mean the mixing rate, I know that's a problem with certain crappy 48khz-native onboard audio.

apsosig.png
long live PCem

Reply 7 of 17, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

With oplrate? I don't mean the mixing rate

oplrate should equal the mixer rate since there's no real resampling done.

Reply 8 of 17, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

yeps. Once I finish that, the oplrate could be set to 49716 by default

Water flows down the stream
How to ask questions the smart way!

Reply 9 of 17, by rfnagel

User metadata
Rank Oldbie
Rank
Oldbie
ripsaw8080 wrote:

The MAP12 music in DOOM II (the MUS resource inside the DOOM2.WAD file is D_THEDA2) sounds strange with DOSBox's OPL emulation, but I don't remember how it should sound because I had a WaveBlaster back in the day. The bass line and cymbal hits seem odd, and changing the oplemu and oplmode settings doesn't appear to make a difference.

You sparked my curiosity, so's I did a bit of testing myself.

I haven't listened to your MP3s, but I tried DOOM2's Map12 music under DOSBox versions 0.73 and 0.74. I could hear that horrible bass line that you were refering to.

I then installed DOOM2 on my other PC (running W98SE/DOS7): That older PC has an ISA Sound Blaster 16, as well as my Wave Blaster 1 installed in it <WOOHOO!> ('twas one of the reasons that I built up that old clunker, to house my WB1).

Configuring DOOM2 for Adlib/Sound Blaster/PAS music resulted in EXACTLY the same horrid sound... so's I'm assuming it's something with DOOM2 (or rather, with it's GENMIDI resource), and not with DOSBox. In other words, DOSBox faithfully re-creates the sound to a "T" <grin> 😀

Hehe, of course I was then obligated to configure DOOM2 for my Wave Blaster 1. Ahhh... the memories 😀

ripsaw8080 wrote:

Also discovered something interesting: using a WAD tool to create a PWAD (patch WAD) of the GENMIDI resource from DOOM and loading it into DOOM II, the bass line for the MAP12 music sounds a lot better to my ears, but the cymbal hits are still rather harsh.

As far as the GENMIDI resources, quite surprising that they were different for DOOM1 and DOOM2. Hmmm (just a-pondering here)... I wonder of there are any differences with the GENMIDI resources for Heretic and Hexen as well?

(Edit) Something I didn't try though:

I wonder if "SET DMXOPTION=-opl3-phase" and/or "DOOM.EXE -opl3 -phase" would make it sound any better (enables Stereo FM music)?

Rich ¥Weeds¥ Nagel
http://www.richnagel.net

Reply 10 of 17, by leileilol

User metadata
Rank l33t++
Rank
l33t++
rfnagel wrote:

I wonder of there are any differences with the GENMIDI resources for Heretic and Hexen as well?

Yes.

apsosig.png
long live PCem

Reply 11 of 17, by telanus

User metadata
Rank Newbie
Rank
Newbie

Just for Info:

I've ran Doom 95 under Dosbox and the music plays ok, Using everything on default

Also tested vanilla flavoured Doom II and sounds the same as the Doom95 version

http://www.multiupload.com/31STZXDGIZ

Reply 12 of 17, by leileilol

User metadata
Rank l33t++
Rank
l33t++

Doom95 doesn't even use OPL. It interfaces with the MIDI Mapper which doesn't give a damn for Doom's timbres, so it can not sound the same.

apsosig.png
long live PCem

Reply 13 of 17, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Although oplrate=49716 is optimal, it doesn't really improve the MAP12 music much. I made the MP3s with 44100Hz, 128kbps CBR because it's standard. I usually use 48000Hz for all rates in DOSBox because my Audigy 2 ZS souncard has its DSP locked at that rate, and its resampling in hardware is poor.

rfnagel wrote:

In other words, DOSBox faithfully re-creates the sound to a "T" <grin>

Thanks for trying it out on your "old clunker". It's good that DOSBox is reproducing the sound, unsavory bits included. I had an SBPro2 when DOOM was first released, and I recall the OPL music was generally quite good there; then upgraded to an SB16+WB before DOOM II was released, and I guess I was spared its (occasionally) flawed OPL music.

rfnagel wrote:

I wonder if "SET DMXOPTION=-opl3-phase" and/or "DOOM.EXE -opl3 -phase" would make it sound any better (enables Stereo FM music)?

Those options don't seem to help the music sound better, but they do apply some tricks (instrument panning being an obvious one) that make stereo separation more apparent.

Last edited by ripsaw8080 on 2010-11-26, 05:57. Edited 1 time in total.

Reply 14 of 17, by rfnagel

User metadata
Rank Oldbie
Rank
Oldbie

For anyone wishing to play around with this: Attached is the archive "GENMIDI_Resource_WADs.zip".

I extracted the GENMIDI resource lumps from DOOM1/DOOM2/HERECTIC/HEXEN (note that I didn't extract the one for Strife, couldn't easily do that with Jim Flyn's "Patcher" utility).

A binary file compare indeed proves that the GENMIDI resource lumps from DOOM1 and DOOM2 are different. The ones from Heretic and Hexen are the same though (although, different from the DOOM1 and DOOM2 ones).

Anyhoo, I created PWADs for all three GENMIDI resource lumps, along with various batch files to fire them up easily with DOOM2 (including a "-WARP 12" to warp to Map 12). Included in the ZIP are:

D1.WAD - PWAD with DOOM1's GENMIDI resource lump.
D2.WAD - PWAD with DOOM2's GENMIDI resource lump.
HX.WAD - PWAD with Heretic/Hexen's GENMIDI resource lump.

D1.BAT - Loads D1.WAD, and warps to Map 12.
D2.BAT - Loads D2.WAD, and warps to Map 12.
HX.BAT - Loads HX.WAD, and warps to Map 12.

D1OPL3.BAT - Loads D1.WAD, warps to Map 01, uses "SET DMXOPTION=-opl3-phase" and "-opl3 -phase".

D2OPL3.BAT - Loads D2.WAD, warps to Map 01, uses "SET DMXOPTION=-opl3-phase" and "-opl3 -phase".

HXOPL3.BAT - Loads HX.WAD, warps to Map 01, uses "SET DMXOPTION=-opl3-phase" and "-opl3 -phase".

FYI, the "-opl3" parameter/environment variable enables OPL3 stereo music. This can be heard quite well within Map 01's music ("D_RUNNIN").

BTW, the "-phase" parameter/environment variable enables sort of a 2-channel stereo surround-sound type of effect for the digital sound effects.

Last edited by rfnagel on 2010-11-26, 06:05. Edited 1 time in total.

Rich ¥Weeds¥ Nagel
http://www.richnagel.net

Reply 15 of 17, by rfnagel

User metadata
Rank Oldbie
Rank
Oldbie
ripsaw8080 wrote:

It's good that DOSBox is reproducing the sound, unsavory bits included.

Yep yep, agreed 😀

ripsaw8080 wrote:

I had an SBPro II when DOOM was first released, and I recall the OPL music was generally quite good there; then upgraded to an SB16+WB before DOOM II was released, and I guess I was spared its (occasionally) flawed OPL music.

I can't really remember, but I think I had my WB1 as far back as when DOOM1 was released. The only time I ever remember hearing OPL was when working on customers' PCs... and I'm sure that I coukd have easily overlooked (over-heard <grin>?) the music for Map 12 of DOOM2.

ripsaw8080 wrote:

Those options don't seem to help the music sound better, but they do apply some tricks (instrument panning being an obvious one) that makes stereo separation more apparent.

Yeah, that's what I was thinking (see my post above).

(edit) Anyhoo, it's amazing that id Software would have missed something like this for DOOM2's GENMIDI resource lump... that bass sound is horrid <grin>. BTW, FYI the MIDI patch for the rank sound is a "Fretless Bass".

Rich ¥Weeds¥ Nagel
http://www.richnagel.net

Reply 16 of 17, by rfnagel

User metadata
Rank Oldbie
Rank
Oldbie

BTW, a few files over at the DOOM World Archives that may prove useful and/or something to play around with:

Hell's Games Music
http://www.doomworld.com/idgames/index.php?id=8233

midinfo.zip
http://www.doomworld.com/idgames/index.php?id=574

bsdmidi.zip
http://www.doomworld.com/idgames/index.php?id=15233

genmid01.zip
http://www.doomworld.com/idgames/index.php?id=11365

Rich ¥Weeds¥ Nagel
http://www.richnagel.net

Reply 17 of 17, by RaVeN-05

User metadata
Rank Oldbie
Rank
Oldbie

"map12_gm_vsc.mp3 (274.69kB) - Downloaded 12 Time(s)
GM using Virtual Sound Canvas"
Sounds like default MIDI.
As i can remember from my old PC, music same as in dosbox.
I check it in GZDoom i get same results.
"GENMIDI_Resource_WADs.zip (11.86kB) - Downloaded 2 Time(s)"
Yes with d1 or d1opl3 or hx or hxopl3 music on map12 plays perfectly

https://www.youtube.com/user/whitemagicraven
https://go.twitch.tv/whitemagicraventv