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

Getting a classic OPL3 sound via Windows midi playback

Recommended Posts

Recently I read a blog post talking about how to get a classic OPL3/Adlib/Soundblaster sound via Windows midi playback.
Basically, anything midi you normally hear will sound like oldschool DOS music. It's pretty simple to follow and the programs mentioned don't cost any money. EDIT: The soundfont mentioned is not commercial, it was home made.

Someone mentioned to me that ASIO drivers might be required, though I'm not sure because I already had some installed.
I use ASIO4ALL, which you can get here: http://www.asio4all.com

I'll link a few sample recordings I made here(in ogg vorbis, not mp3, in case anyone was wondering):
Title from Doom 2
Grabbag from Duke Nukem 3D

You can also enable a reverb effect in the rgc:audio sfz program if you want, and even change the polyphony to the default 18 like on a real OPL3 chip(IIRC, at least, heh).

I ended up finding more info and choices here: http://www3.telus.net/anapan8/oldscardemu.htm
Including a soundfont based on The Fat Man's OPL2 bank/timbres.(direct link ) I'll have to try it in my Windows copy of The 7th Guest sometime.

EDIT: This is for General MIDI playback, and not emulation, in case the soundfonts didn't tip you off.

Share this post


Link to post

this isn't opl3 perse, but opl3 on the soundblaster, playing soundblaster general midi.
In other words, canyon.mid will.. sound like canyon.mid again :D

Share this post


Link to post
Infurnus said:

and even change the polyphony to the default 18 like on a real OPL3 chip

For what it's worth OPL3 can do 18 dual-operator voices, but then you cannot use any OPL3 instruments since they are 4-operator voices.

Share this post


Link to post
Ajapted said:

For what it's worth OPL3 can do 18 dual-operator voices, but then you cannot use any OPL3 instruments since they are 4-operator voices.


this always has irked me. i ran into this when playig with adlib tracker.

Share this post


Link to post

Sorry to break it for you (and the guys at that blog) but there's a much more elegant way to play midis with an FM sound, which I have pimped discussed many times here at DW, including this thread.

To make a long story short, get fmmidi, a free FM OPL4 emulator that plays MIDI files directly using programmable FM timbres and real-time (emulated) FM synthesis.

There's also Adplug, which is a plug-in module (also for Winamp) that allows real-time FM synthesis emulation, and the ability to play back a lot of classic DOS era FM music files in obscure and exotic format (dunno if they extended it to a complete MIDI driver though).

To anyone doubting the quality of the emulated FM synthesis: it's bit-accurate. Surprisingly, the OPL2/OPL3/OPL4 line didn't use any analog oscillators or filters: the waveforms were generated digitally via lookup tables, channel manipulation was purely digital, mixing was done digitally, and the result was played back by a DAC external to the chip, at over 48KHz. So, perfect emulation is possible (of course, it may not sound like your "1000W P.M.P.O. MULTIMEDIA SPEAKERS" sounded in 1995).

Also, remember that not all DOS games using "midi" sound used the same timbres ;-)

Doom used a particularly good set, other games used generic Miles/Voyetra timbres that sounded bland, and a rare minority used direct control of the FM chip with feedback etc.

Ask me about FM synthesis ;-)

Share this post


Link to post
Maes said:

Also, remember that not all DOS games using "midi" sound used the same timbres ;-)

The question, then, is "how to obtain these timbres from the game, since they must be somewhere in there".

Share this post


Link to post
Gez said:

The question, then, is "how to obtain these timbres from the game, since they must be somewhere in there".


Depends on the game: Doom used a lump somewhere in the IWADs, which however has to be mapped to the FM registers in a specific way.

In a few other DOS games there were aptly-named external "SOUNDS.OP2", "INSTR.OPL" or "TIMBRES.SND" files, the details of which were, again, hidden in some binary blob somewhere (although most were simply direct OPL2 register dumps).

An example is the GENMIDI lump used in Doom engine games (with the DMX sound library).

I know where you're taking it, but no utility I know of can use those directly, with the exception of MUSplayer for GENMIDI lumps and of Doom source ports with FM synthesis emulation, such as ZDoom.\

With FM Midi you could define all instruments by hand, if you can master the interface to that degree.

Also, a few games didn't use static FM timbres at all: e.g. Body Blows had an unusually complex sound system which generated very rich FM music with sound feedback and direct speech synthesis without the use of samples. The only way to play those back are raw dump formats (Adplug supports those, though).

Share this post


Link to post
Maes said:

I know where you're taking it, but no utility I know of can use those directly, with the exception of MUSplayer for GENMIDI lumps and of Doom source ports with FM synthesis emulation, such as ZDoom.

But are they bit perfect like you said those fancy Japanese things are?

Share this post


Link to post
Gez said:

But are they bit perfect like you said those fancy Japanese things are?


To the degree their FM engine is accurate ;-)

To the best of my knowledge, the FM emulator used in ZDoom is as good as FMMidi's, only not as versatile (an MCI driver version of either would be cool, though).

Being a digital system, there is One and Only One way to correctly implement it, and One and Only One output associated with a particular internal status. There are no analog parts in the OPL2 chips, so forget mythical stories about "analog warmth", about "different sounding chips" etc.

As long as the look-up tables for waveforms are identical , the same formulas and timings are used for applying effects etc. then each and every OPL2/OPL3 chip (and a properly made emulator) should just sound exactly the same, period.

Accounts of either sounding "different" is often due to one's being used to associating FM Sound with the particular speaker and soundcard setup he was using for years (most of us poor grunts used those nasty "1000 W PMPO Multimedia speakers", and older soundcards had on-board power amplifiers, which added their own distortion and colorizing to the sound). Some even had a built-in "3D" sound effect which did weird things to the sound like artificially widening channel separation or filtering the output.

Emulators just produce a "clean" output like the external output DAC of the OPL chips would produce.

Share this post


Link to post

I should note that as a good base for such MCI driver, DOSBox v0.73 has a new OPL2/3 core. I wouldn't go near zdoom's or fmmidi's.

Share this post


Link to post

Infurnus said:
I'll link a few sample recordings I made here(in ogg vorbis, not mp3, in case anyone was wondering):
Title from Doom 2
Grabbag from Duke Nukem 3D
[/B]

And surprise, surprise, these sound nothing like how they actually sound when played in the actual games under DOS.

The problem with OPL playback is that the OPL chip is just a bunch of generic "noise making boxes" (voices). To play back MIDI, you have a collection of register values, one for each of the MIDI instruments. When you want to play an electric guitar sound, you load the appropriate register values for an electric guitar, and a noise somewhat like an electric guitar comes out.

The problem is that every game or other piece of software that plays OPL MIDI has a different set of register values that it uses. The same MIDI file played back under Doom and Windows will sound completely different, even though it's using the same hardware. You'll notice that if you're using Boom under DOS, even that plays back music differently to Vanilla Doom. It doesn't use the register values from the GENMIDI lump in the IWAD like Vanilla does.

I'm in the process of developing Chocolate Doom's OPL support, for which I'm aiming to do the exact same register writes that Vanilla Doom does. I'm also aiming to support hardware OPL passthrough (in addition to OPL emulation), so it should be possible to drive a real Soundblaster when it's all finished. I already have my Yamaha YMF724-based sound card playing back Dosbox raw OPL dumps :-)

Share this post


Link to post
leileilol said:

I should note that as a good base for such MCI driver, DOSBox v0.73 has a new OPL2/3 core.

I will definitely check that out, hopefully this new core is GPL compatible i.e. not using any of Jarek Burczynski's MAME code.

EDIT: omg they used Ken Silverman's ADLIBEMU code as a base.

Share this post


Link to post
Ajapted said:

I will definitely check that out, hopefully this new core is GPL compatible i.e. not using any of Jarek Burczynski's MAME code.

EDIT: omg they used Ken Silverman's ADLIBEMU code as a base.

Yeah, I already discussed this on IRC with the guy who's written the new code. The ADLIBEMU code isn't GPL compatible, but apparently there's basically nothing left of the original code anyway. It's all been rewritten.

Share this post


Link to post
fraggle said:

Yeah, I already discussed this on IRC with the guy who's written the new code. The ADLIBEMU code isn't GPL compatible, but apparently there's basically nothing left of the original code anyway. It's all been rewritten.


awesome. does this mean that chocopl gets a boost?

Share this post


Link to post
Csonicgo said:

awesome. does this mean that chocopl gets a boost?

Possibly, but it's written in C++ so I would have to adapt it. For the time being I'm going to proceed with the ScummVM emulator code and see how it goes. I want to get the actual playback code working first :-)

Share this post


Link to post
Maes said:

Sorry to break it for you (and the guys at that blog) but there's a much more elegant way to play midis with an FM sound

I just posted this to show that there's a way to make the Windows midi device sound like the old OPL/Adlib sounds we remember from years ago.
The things you suggest only play back midi files that are loaded, while this method, though not elegant, can be used in programs that just play back midi through the midi driver itself.

I actually haven't been using the OPL soundfont much, right now I've got the Airfont soundfont loaded, and I like having the ability to choose something other than the old Roland softsynth anyways. I also have Yamaha XG installed, but it gives me performance issues most of the time, and rgc:audio sfz does not, and lets me use whatever soundfonts I want.
Personally, I wish I could pry the sound card out of my old PC and shove it into this new one but I doubt it, especially since my current PC has one of those awful BTX motherboards.

It's nice to see these discussions going on, and to hear about stuff like Chocolate Doom's OPL support. :)

Share this post


Link to post
Infurnus said:

Personally, I wish I could pry the sound card out of my old PC and shove it into this new one but I doubt it, especially since my current PC has one of those awful BTX motherboards.

All (as far as I know?) sound cards with a "real" OPL in were ISA, and no modern motherboards have ISA slots, so that won't work. There are a few PCI cards that have legacy support that emulates OPL output (mentioned on the opl-branch page I linked to), but I'm not certain that the sound output is identical to a real OPL from these.

Share this post


Link to post

Thought not :-) I'm pretty sure I saw leileilol discussing it a while back.

Oh well, even if the card in my machine isn't perfect, at least I can use it to test that playback works properly.

Share this post


Link to post
Ajapted said:

Yeah even the OPL on the AWE32/64 card sounded different than a real OPL card.


The same misconception, once again: the OPL chip sounds exactly the same everywhere, and since the synthesis process is entirely digital there's no such thing as "analog warmth" or "approximation errors" or "component tolerances", and not even "different" OPL chips, ever.

If anything, the AWE32/64 actually sounded closer to how it was supposed to sound, as the OPL was directly connected to the digital mixer, while typical soundcards had a lot of analog circuitry before the output (and many even had built-in amplifiers and analog "3D enhancers" or "bass boosters")

However, not all software uses it in the same manner. You can even get an Adlib with an OPL2 to output very different "FM music" with DOOM, under DOS, if you use it as "general midi" device.

The guys making that soundfont stuff fell into the same gross error, thinking that FM sound = a particular collection of timbres, not even the best available may I add.

fraggle said:

AThere are a few PCI cards that have legacy support that emulates OPL output (mentioned on the opl-branch page I linked to), but I'm not certain that the sound output is identical to a real OPL from these.


Some like the Yamaha waveforce have an Ensoniq core which I recall includes a proper OPL3 core. Needless to say though, the default timbres when using it as a MIDI device under windows are terrible. I recall that I could get much better FM midi from my SB16 by loading a tweaked MCI midi driver that used Voyetra timbres (under win 3.1) but no idea if this is possible after windows 95.

Share this post


Link to post

Heh, this discussion of "analog warmth" is starting to sound like one of those crazy audiophile discussions where someone tries to claim that vinyl records are higher quality than CDs :-)

A quick Google search seems to imply that the Waveforce has a YMF724 in, same as mine. Personally I'm not entirely sure that its output sounds exactly like the same output did years ago under DOS (I used to have a Voyetra ISP-16, which presumably had a real OPL on it). Then again, it could be that it's actually higher quality. I don't know.

The question of the OPL hardware is the key thing though, surely? Did the AWE32 have a real OPL3 chip on it? If it was integrated as part of another chip then it's not unreasonable to think that the output could be subtly different. The YMF724 has the OPL implemented as an internal "block", for example. I don't think it's unreasonable to think that this might be implemented slightly differently to the original OPL chips, just like how the software OPL emulators all sound subtly different to a real OPL chip.

Share this post


Link to post

AWE32 FM does sound different from Adlib FM.

The output of the OPL chip is probably the same but the filtering and/or mixing after that is different.

Share this post


Link to post

It should also be noted there are many models of the AWE32 and 64 without the Yamaha YMF262 chip and a low cost Creative FM chip substituted instead, which sounds much more grating.

Share this post


Link to post
Ajapted said:

AWE32 FM does sound different from Adlib FM.

The output of the OPL chip is probably the same but the filtering and/or mixing after that is different.


There you have it: defining one particular soundcard's analog output as "the One Way the Chip should sound", which is totally unapplicable to analog systems. On the opposite, the chip's raw output is always predictable and is the way it should sound.

As I said, it seems that everyone and the cat pretends that OPL emulators should sound just like their OPL3 "SB compatible" ISA card from 1995 sounded like through a pair of matched "1000 W PMPO multimedia speakers".

leileilol said:

It should also be noted there are many models of the AWE32 and 64 without the Yamaha YMF262 chip and a low cost Creative FM chip substituted instead, which sounds much more grating.


Not improbable, seen how there were e.g. low cost pin & register compatible versions of other Yamaha sound chips used in some arcade systems and consoles, or improper setups (most often, lower-clocked external DAC which fux3d the sound up) but are there actual documented instances of "cut down" or simplified OPL2/OPL3 chips? Or is it yet another case of "analog warmth"?

Share this post


Link to post
leileilol said:

It should also be noted there are many models of the AWE32 and 64 without the Yamaha YMF262 chip and a low cost Creative FM chip substituted instead, which sounds much more grating.

Yeah, my model CT4380 AWE64 is missing the Yamaha chip :(

Share this post


Link to post
Maes said:

There you have it: defining one particular soundcard's analog output as "the One Way the Chip should sound", which is totally unapplicable to analog systems. On the opposite, the chip's raw output is always predictable and is the way it should sound.

I think the question is whether the digital output of embedded/third party cores like those used on the AWE32/64 or YMF724 really is the same as the digital output of the original OPL chips. I'm not so sure.

Certainly for third party clones I doubt the digital output is the same. The OPL documentation certainly isn't accurate enough to create a bit-accurate copy, otherwise we'd have "perfect" OPL software emulation by now :-)

Share this post


Link to post
fraggle said:

I think the question is whether the digital output of embedded/third party cores like those used on the AWE32/64 or YMF724 really is the same as the digital output of the original OPL chips. I'm not so sure.
Certainly for third party clones I doubt the digital output is the same.


Considering how chips are made with photolithography by copying masks which are hard to modify, it's very improbable they'd bother to do so rather than just reuse them. The only parts which are easier to modify are the DDS waveforms (essentially, a stored sine wave and a log wave).


The OPL documentation certainly isn't accurate enough to create a bit-accurate copy, otherwise we'd have "perfect" OPL software emulation by now :-)


And who said that we don't? (based on objective criteria however, and not by Mac fanboys using "FM soundfonts").

It's a bit like when you buy a record/CD of your favourite song only to discover that it somehow doesn't sound like it did when you listened to it on your radio/TV.

Share this post


Link to post

For history's sake, I set up my oldskool K6-200 machine with a pure DOS (6.2) installation and an AWE64 Sound Blaster, which has the choice between OPL3 and onboard wavetable MIDI.

The result? All of my old games sounded exactly like they did on my SB 2.0 and later on my SB16, as long as I chose Adlib/Soundblaster for sound.

When I chose "General Midi" however it was another story altogether, since the wavetable kicked in.

This included Doom: with SoundBlaster settings for both music/sound, it just sounded like it always did: good old FM sound with Doom's sweet, sweet FM timbres :-)

No audible differences from ZDoom's FM emulator, either.

The only difference was that now I wasn't using the particular bass-boosted speakers I used in my old box, so it sounded differently from what I had grown used to, but I couldn't be assed to find where I had dumped them to try them back in :-p

Share this post


Link to post

That soundfont trick sounds terrible. Almost as bad as when the MIDI players included in Windows tended to screw up things like pitch bends.

My olde solution to listening to olde MIDI files was to use DOS players in DOSbox. It was a clunky solution.

I'm a little surprised Adplug never get proper support for playing MIDI files with the timbres adjusted to sound like various media players from the days olde. Of those I think the best I heard was an Ensoniq one from 1999. It was in a Thinkpad.

To the growing collection of interesting players I submit HTSFMS -- whatever that means. There seem to be a lot of Japanese players around that do interesting things and have garbage UIs. This is one. It doesn't emulate OPL at all; it does its own thing with more operators and can be programmed with text files (if you can figure out the Japanese docs). The newest version on that page is the most stable but has nothing but a black window for you to drag/drop files. The older one has a better UI but it's crashy. Anyway, it sounds quite good for DOOM music, and also most game music I have.

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
×