Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Crusader Mike

MUS player (with sources)

Recommended Posts

Hi

I am looking for a MUS player that plays music as close to DOOM's engine as possible.

Basically, I want to create Windows driver for virtual MIDI device that will produce the same music we have heard on our SB16s while playing Doom2 long ago. So far I have tried to:
- convert MIDI to MUS 'on-the-fly'
- play MUS according to algorithm listed in NWT's sources

unfortunately, it plays some music clearly wrong.

Any ideas where I can get more precise playback algorithm?

Bye.
Sincerely yours, Mike.

Share this post


Link to post
Crusader Mike said:

Hi

I am looking for a MUS player that plays music as close to DOOM's engine as possible.


Define 'as close as possible'.

The problem is there is no such thing because even back in 1993 the output heavily depended on the sound card's capabilities. With high end cards you got good wavetable sound even back then.

But since you are looking for an OPL player which was the standard for most cards back then you will most likely not find anything because the one in Doom was quite good and none of the emulators I have seen over the years even comes close to what Doom was capable to get out of such limited hardware.

Share this post


Link to post
Graf Zahl said:

Define 'as close as possible'.

Lets define a manifold of possibilities given individual know about and call it P.
Lets define f(p) as transformation from P to some value which is a list of OPL3 commands along with their timestamps. if p is not about playing a MUS file then f(p) = nothing.
Also for some p1 != p2 lets assume f(p1) = f(p2) if given OPL3 chip output won't differ due to it's internal logic (for example some OPL3 commands could switch places without affecting output)
Lets assume there is a measure N(p1, p2), which defines how close f(p1) to f(p2) according to normal human perception.
Task is to minimize N*(p) = N(p0, p), where p0 -- predefined case (Doom music engine), p -- from given individual's manifold P.

Is it clearer now? :-) Obviously the best solution for given exercise is p0. But where to get DOOM's music engine sources? I am very bad in terms of debugging DOS code.

Graf Zahl said:

But since you are looking for an OPL player which was the standard for most cards back then you will most likely not find anything because the one in Doom was quite good and none of the emulators I have seen over the years even comes close to what Doom was capable to get out of such limited hardware.

Yes, I am looking for OPL3 implementation of FM synthesizer that will give me Doom-like music.
Actually I've found that NWT got synth code from MUSplayer written by Vladimir Arnost. I've got latest version of his player, but it sound even more different. Then I realized that it uses different instrument set, I have extracted GENMIDI.OP2 from Doom2.wad and used it with MUSPlayer -- now it plays very close to Doom, but there are couple of places where sound is different.

I wonder if anybody by chance have seen "better" MUS player for Doom MUS files?

P.S. And by the way -- I like how Doom sounds on OPL2/3. All this wavetable/sampled/GUS/AWE stuff sucks when used with Doom. Well, at least for my ears. That is why I am trying to create aforementioned driver -- Doom runs fine in VirtualPC (which is free now), all it lacks is music.

Share this post


Link to post
Crusader Mike said:

Yes, I am looking for OPL3 implementation of FM synthesizer that will give me Doom-like music.
Actually I've found that NWT got synth code from MUSplayer written by Vladimir Arnost. I've got latest version of his player, but it sound even more different. Then I realized that it uses different instrument set, I have extracted GENMIDI.OP2 from Doom2.wad and used it with MUSPlayer -- now it plays very close to Doom, but there are couple of places where sound is different.

I wonder if anybody by chance have seen "better" MUS player for Doom MUS files?


I doubt you will find anything better. ZDoom uses the same one and I always found it sounds rather weak and doesn't compare with how Doom's music sounded with the original.

Share this post


Link to post

It's true that Doom used the OPL2 chip much better than 99% of its contemporary software. Basically, most game titles of the time (especially those using MILES sound library) used Adlib/SB's OPL2 just as a MIDI output device, and used some bog standard "timbres" for instruments, which generally sounded extremely bland.

Some others, like Doom, used OPL2 in a MIDI-esque way but at least they did so with their own sets of custom timbres, which kicked "standard issue" GM timbres' ass anytime (in fact, DOOM played back MIDI files much, much better than e.g. Creative or Windows media player did at the time, on the same hardware, even with OPL3).

OPL3 was substantially underutilised by games and midi applications alike: they just used the aforementioned "generic" GM OPL timbres which in no way did the OPL3 justice, and sometimes they even used it in OPL2 mode, which was a waste. I never heard how DOOM used the OPL3, so I can't tell.

Some other (very few) titles used the OPL2 in incredible ways: Body Blows used such kickass playback routines using effect feedback and the such, that it made OPL2 sound better than a MOD file and was even able to synthesize speech using only a "humble" AdLib. Minimal CPU usage and kickass sound...

*cough cough* well about Doom, what the others said is right: DOSBOX or any other OPL2/3 emulator is the closest you can get. Even assuming you don't have outright errors in the playing/conversion routines, you'll always discover minor or major glitches between an emulator or the other. There were even clone SB soundcards at the time which used OPL2/OPL3 yet sounded different (e.g. unwanted stereo and exagerrated reverb when configuring Doom to use AdLib (mono) sound for music)

Share this post


Link to post
Crusader Mike said:

I wonder if anybody by chance have seen "better" MUS player for Doom MUS files?

I'm not sure what version of MusPlay NWT's player is based on, but perhaps the latest version has some improvements over it. I quite doubt there's anything closer to DOOM's OPL sound than MusPlay. The player's library should also be of use.

Share this post


Link to post
fraggle said:

Try running Vanilla Doom inside DOSBox. It has pretty accurate-ish OPL emulation.

Real shame that they are using the enhanced fmopl code which is not compatible with the GPL. Arrgghh!

Share this post


Link to post
Ajapted said:

Real shame that they are using the enhanced fmopl code which is not compatible with the GPL. Arrgghh!


Actually, they avoided using the horrible relicensed MAME YM8132 code.

Share this post


Link to post
leileilol said:

Actually, they avoided using the horrible relicensed MAME YM8132 code.

How do you know? I've just looked in the DOSBox 0.65 source and the fmopl.c code is Jarek Burczynski's enhanced version (v0.70).

Share this post


Link to post
Ajapted said:

How do you know? I've just looked in the DOSBox 0.65 source and the fmopl.c code is Jarek Burczynski's enhanced version (v0.70).


it is used there for OPL2 emulation. For OPL3 they use ymf262.c. Code is horrible, but works.

Actually the main problem is not OPL emulation -- I assume ymf262.c eulates real OPL3 pretty closely or maybe exactly. Problem is to play given MUS -- i.e. convert notes messages and stuff to related writes to OPL registers.

Actually I am using DosBox to check how Doom plays in comparison with my own synth. Also I have modified and recompiled DosBox to log all OPL writes when I decided to compare my synth output and Dooms -- they were quite different :-). The same for latest MUSplayer and Doom.

Also, for those who are of curious nature -- try this:
1. run MUSplayer under DosBox
2. replace genmidi.op2 provided with MUSplayer with one, located in doom2.wad
3. play some MUS files extracted from Doom2.wad -- you'll notice it plays almost the same as Doom, but more quiet.
4. in Doom2 try first level and listen to the music (full volume - 15), reduce volume to 10 and listen again. As you may noticed some of the drums sounds absolutely different!

Actually I suspect that Doom artificially and non-linearly increases notes and channel volumes -- when I tried to simply increase volumes by const value 20-27 -- my player started playing 'closer'.

5. also -- if you listen to first level music you'll notice some metallic after-affects after specific drum-sound. In Doom it mostly sounds short and subdued, in MUSplayer you could hear it every time in it's full glory. :-(

I'll go ahead with the latest MUSlib sources and then attempt to move it onto kernel level as WDM driver. (I've heard MS dropped it from Vista O_O, or they move all sound stuff to user level) After that if sound is still wrong... Well, maybe I'll try to reverse engineer Doom's engine code, I've seen some support in DosBox's code.

Share this post


Link to post

Interesting moment. I remember how sounds FM music in doom on my authentic creative SB16 ASP ten years ago. Rock solid and correct playback. Now even with real awe32/awe64 cards it sounds much different. But musplay plays extracted doom mus files absolutely correct and the same as my old SB16 with any parameters (/d1 /d2 /1) just give stereo effect but sounds absolutely right.
What wrong with doom internal DMX driver and newer EMU8000 based cards?

Share this post


Link to post
c.imp said:

Interesting moment. I remember how sounds FM music in doom on my authentic creative SB16 ASP ten years ago. Rock solid and correct playback. Now even with real awe32/awe64 cards it sounds much different. But musplay plays extracted doom mus files absolutely correct and the same as my old SB16 with any parameters (/d1 /d2 /1) just give stereo effect but sounds absolutely right.
What wrong with doom internal DMX driver and newer EMU8000 based cards?


1. Are you sure it plays absolutely correct? can you listen to first level music (D_RUNNIN.MUS) until the end? my MUSplayer from under dosbox was playing last third incorrect until I replaced genmidi.op2.
2. maybe this will give you hints what is wrong win AWE32: http://en.wikipedia.org/wiki/AWE32
3. Could you, please, check if you have metallic after-sounds in some drums on real hardware? (run first level, wait for ~10-15 seconds)

Share this post


Link to post

Yeah i'm sure. Mike, maybe you forgot that i have real ISA AWE64 (AWE32 before too) and don't use PCI soundcard or DOSBOX SB emulation for that. And musplay plays doom mus files 200% correct with my AWE64 as good old SB16 ASP with real Yamaha OPL but ingame sounds different.
Ofcource i listen with musplay d_runnin (and others) until end and did't notice any differences. It is absolutelly correct for me. But in game some instruments plays shortly or even missing! Seems like DMX driver not functioning properly on newer cards wich have integral in main DSP opl chip.

Share this post


Link to post

I've got both the original SB-8 card and AWE32, haven't used them in a looong time but I remember the FM music on the AWE32 did sound different than the SB-8, not as "full" if that makes sense, perhaps because the signal from the OPL chip is filtered differently.

Share this post


Link to post

Has anyone just output from a dosbox(as in an old computer with real OPL sound card, not the emu) and recorded some high quality mp3's or vorbis files of the music from actual OPL hardware? Seems like a much easier solution to me.

Share this post


Link to post

Funny that you mention it, but DOSBox works great for recreating the old OPL sound of the music. Just run setup.exe and set the music device to "Sound Blaster".

Share this post


Link to post

leileilol said:
I was going to make a OGG'd fm songs wad from my SB16, but i'm lazy

I got through the music from Doom using an SBPro, but got bored and haven't done Doom 2 yet...

Share this post


Link to post

Any way I could convince you to share the Doom 1 stuff with me? I'd be happy to seed a torrent of said ogg's/mp3's forevermore if I could get my hands on them. I know there is at least a moderate interest in the old OPL driven soundtrack, you can see griping about poor emulation on just about every doom forum around. Not to mention my own huge interest. :)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×