VOGONS

Common searches


Authenticity of AdLib sound

Topic actions

First post, by Angus

User metadata
Rank Newbie
Rank
Newbie

I'm wondering just how closely DosBox emulates the actual output of the AdLib music card. If I went out and bought an AdLib card off eBay then bought a motherboard with ISA on it, would I be able to tell the difference? I'm listening to something that I played on a real AdLib >10 years ago, and it doesn't sound exactly like I remember it.
I'm hesitant to call it AdLib/OPL2 because the same document that tells me OPL2 is the same thing (http://dosbox.sourceforge.net/wiki/index.php?page=Adlib) also says the SoundBlaster is AdLib compatible and therefore makes the AdLib completely obsolete. I've listened to the SoundBlaster emulate AdLib sounds that I'd already heard from an authentic AdLib and I know for a fact they ain't the same thing.

Reply 1 of 44, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

DOSbox Adlib sound regression?

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 2 of 44, by Angus

User metadata
Rank Newbie
Rank
Newbie

Ok, that yarn *seems* to confirm that the SB16 (and a few others) use the same chip as AdLib. But Jez correctly points out that AdLib music sounds better. In fact, this FM that AdLib outputs sounds an awful lot more like Creative's AWE.

But my question about the authenticity of DosBox's music stands. Does DosBox's AdLib music to the same spec as the real AdLib, or is it just a pretty good approximation?

Reply 3 of 44, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

The only difference between Adlib and all the "compatible" cards (all ISA soundblasters and the first few PCI ones) is the actual type of chip. Later cards sometimes came with an OPL-3 chip which had extended capabilities. So programs that support both, OPL-2 and OPL-3 can in fact sound differently depending on hardware and settings. Adlib on a soundblaster doesn't sound any bit like AWE. If it does, maybe your sound card or drivers emulate Adlib via wavetable?

Reply 4 of 44, by Angus

User metadata
Rank Newbie
Rank
Newbie

I shouldn't have said "like". AdLib and AWE sound very different. What I meant was that AdLib and AWE sounded like they were in the same league. The FM synthesis of pre-AWE SoundBlasters had a quality that put them in a much more junior league, according to my ear.

But that is when SBs would run MIDI--not to be confused with SB's AdLib emulation. I don't remember the quality of SB's AdLib emulation, just that I didn't like it as much, which I thought was very different from real AdLib.

So is AdLib sound authenticity in DosBox beyond the scope of this group?

Reply 5 of 44, by jal

User metadata
Rank Oldbie
Rank
Oldbie
Angus wrote:

So is AdLib sound authenticity in DosBox beyond the scope of this group?

I'm not sure about the current status of the Dosbox Adlib emulation (as it is copied form Mame, and I'm not sure whether a) Mame has recently updated and b) Dosbox has incorporated the changes), but 0.65 wasn't quite accurate. I remember especially Rick Dangerous II, which has some instruments playing too soft in the the intro tunes and also some ingame sounds (e.g. the sound of the bonusses) not entirely correct (I checked with an actual Adlib board). Since there are several 'how to rig Adlib to do digital output' tuts available, I think it should be possible to do a 1:1 emulation. But as I said, there's no seperate Dosbox Adlib emulation project (as opposed to e.g. GUS emulation), as they use Mame's.

JAL

Reply 6 of 44, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Mame hasn't updated the last I looked. They use a slightly different version with the only code difference being a name change for one variable or some such. When I tried hunting down more recent opl code the only thing I found were comments that the author changed his license so that only the old version can be used. He made an update or two but I never found the source online.

Reply 8 of 44, by Angus

User metadata
Rank Newbie
Rank
Newbie

What's Mame?

Also, I found a page giving driver specifications on the AdLib: http://www.shipbrook.com/jeff/sb.html. Isn't it pretty straight forward to create a 1:1 emulation with this sort of thing, if you know a very little bit about trigonometry and a good bit more about music theory than I do?

Reply 9 of 44, by eL_PuSHeR

User metadata
Rank Moderator
Rank
Moderator

M.A.M.E. stands for Multiple Arcade Machine Emulation if I am not mistaken. It's a well known emulator for Arcades.

Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
8 GB GeForce GTX 1070 G1 Gaming (Gigabyte)

Reply 10 of 44, by jal

User metadata
Rank Oldbie
Rank
Oldbie
Angus wrote:

What's Mame?

http://en.wikipedia.org/wiki/MAME
http://www.mame.net/

<sarcasm>You know, there's this thing called Google (http://www.google.com) that allows you to quickly find answers to any 'what is XXX (fill in any word)' questions.</sarcasm>

Angus wrote:

Also, I found a page giving driver specifications on the AdLib: http://www.shipbrook.com/jeff/sb.html.

You found a copy of Jeffrey S. Lee's famous AdLib programming manual. It's no driver specification, it's a hardware programming description. And when I say 'famous' I mean famous as in 'every programmer that was doing anything with programming soundcards in the early 90s knows this document' (really, every programmer).

Angus wrote:

Isn't it pretty straight forward to create a 1:1 emulation with this sort of thing, if you know a very little bit about trigonometry and a good bit more about music theory than I do?

No, not at all. If it was, we'd already have done it, wouldn't we? (Ouch, forgot the sarcasm tag!)

<nice>The reason it isn't, is that you feed the AdLib a certain value, and then it decides by itself what waveform to generate. The whole point of an emulator is that it should produce exactly the same waveform. And currently, this is not the case in Mame/Dosbox.</nice>

JAL

Reply 11 of 44, by franpa

User metadata
Rank Oldbie
Rank
Oldbie

we all know jal that google is awesome for people looking for porn related topics.

AMD Ryzen 3700X | ASUS Crosshair Hero VIII (WiFi) | 16GB DDR4 3600MHz RAM | MSI Geforce 1070Ti 8GB | Windows 10 Pro x64.

my website

Reply 12 of 44, by Angus

User metadata
Rank Newbie
Rank
Newbie

<from the hip>That thing called Google is good for answering 'what is XXXX' if the thing named XXXX is the most popular thing named XXXX. After reading the Wiki on MAME I find its relationship to DosBox confusing, so I probably would have guessed that I got the wrong MAME. Now there's this other thing called humanity that supposed to be able to solve almost anything you can throw at it, being far more advanced than any artificial intelligence system available today. In fact, most scientists agree that humanity is not artificially intelligent at all, but is the definitive intelligence.

From reading Jeff's publication it appears that all output from an AdLib is supposed to be a function of these 4 distorted sine waves, at a range of amplitudes, frequencies and phases. I know enough about Fourier to get a rough idea of how and why this differs in practise, but from what I'm hearing, you are telling me that the difference in what OPL promises and the actual output goes way beyond Fourier analysis? Such unpredictable behavior must have put an unnecessary burden on the programmers for OPL in the 90s.

Here's something to muddy the waters even more: I tried capturing the OPL. Then I played the resulting "dro" file on the latest version of WinAmp and they sounded pretty well the same as what DosBox played. Does that mean that WinAmp's dro plugin is also inconsistent with AdLib? Did the plugin-writer draw from the same source as the DosBox developers? I'm going on a few assumptions here:
1) The weakness in DosBox's or MAME's emulation of the OPL chip is in the emulation of the analogue electronics, not any digital part of the data path
2) Dro is not a redigitization of a music card's analogue output, put a transform (which could be 1:1 for all I know) of the digital signal sent to the chip.
3) Using a reverse transform (if necessary) the dro's data could be made into input for an AdLib music card.
Forgive me, I'm a software engineer, not a driver writer, but I want to do hardware some day.

No, I didn't forget to close the AML tag.

Reply 13 of 44, by NewRisingSun

User metadata
Rank Oldbie
Rank
Oldbie

I tried capturing the OPL. Then I played the resulting "dro" file on the latest version of WinAmp and they sounded pretty well the same as what DosBox played. Does that mean that WinAmp's dro plugin is also inconsistent with AdLib?

Yes. I don't think any current OPL2/OPL3 emulator is 100% accurate. The difference might be minimal to nonexistant to the casual listener, but can be made obvious with specifically-prepared examples.
Incorrect FM in Commander Keen 6

The weakness in DosBox's or MAME's emulation of the OPL chip is in the emulation of the analogue electronics, not any digital part of the data path

I'm not aware that the OPL chips even have an analogue part. Their input is digital (register data for its generator cells), their output is digital (serial 16-bit PCM data for the separate YAC512 digital-to-analog converter).

By the way, forget about the AWE, which doesn't even have an OPL chip; its EMU-8000 chip just tries to emulate it. It shouldn't be used as an indicator for anything. Compare Adlib/SoundBlaster (OPL2) and Sound Blaster Pro 2/Sound Blaster 16 to DosBox'/MAME's/AdPLug's emulation and forget about the AWE.

Reply 14 of 44, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

By the way, forget about the AWE, which doesn't even have an OPL chip; its EMU-8000 chip just tries to emulate it. It shouldn't be used as an indicator for anything. Compare Adlib/SoundBlaster (OPL2) and Sound Blaster Pro 2/Sound Blaster 16 to DosBox'/MAME's/AdPLug's emulation and forget about the AWE.

I have seen AWE32s that seem to use Creative chips with OPL3 hardware inside them. My CT-2760 has a Creative chip clearly marked OPL3. I have also seen Sound Blaster 32s that actually have real Yamaha YM-262s in addition to the EMU8000 chip. In short, I don't believe the early AWEs use the EMU8000 to emulate OPL3. I cannot speak for the later AWEs.

Reply 15 of 44, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

As far as i understood it's not possible to emulate sound
generated as described in
http://repetae.net/john/computer/opledit/tech/adlib2.txt
with the current implementation. Srecko might tell more
about that.

Reply 17 of 44, by Srecko

User metadata
Rank Member
Rank
Member

Here's my theory 😀

In current design of OPL2 emulation (applies also to OPL3), sampling function (mixer callback), which creates about 20 samples at once, is called periodically by dosbox timer (for 22kHz this requires about 1ms intervals!). So this means that chip registers for those 20 samples can't change (are constant per that sample bunch). Waveforms are evaluated for each sample (emulation of analog waveform in time) but same register parameters are applied every time.

Programs which use adlib for reproduction of digitised sound try to change adlib registers more often than dosbox can apply them to samples, so it doesn't sound good. Regarding FM music it is probably barely audible.

Last edited by Srecko on 2007-01-22, 12:46. Edited 2 times in total.

Reply 18 of 44, by NewRisingSun

User metadata
Rank Oldbie
Rank
Oldbie

Perhaps he's being confused with the Sound Blaster Live!

No, it is you people who are confused:

The AWE64 also has a native OPL3 chip as well.

I have an AWE64 Gold (CT4540). When running under DOS with your AWE32/AWE64, do you run a utility called "AWEUTIL /S" at boot time (not memory-resident)?

If yes, and if FM doesn't work if you don't run the utility that way, the OPL3 sound is NOT native OPL3. The real Yamaha OPL3 chip doesn't need to be "woken up" with AWEUTIL.

The "Creative OPL" chip Great Hierophant is talking about might very well just be translating OPL3 chip writes into the appropriate Emu-8000 writes, and AWEUTIL /S just sets up the Emu-8000 to accept these writes.

It's also possible that the "Creative OPL" chip is really some kind of FM-producing chip, and the AWEUTIL /S line just makes the Emu-8000 accept its output. But either way, it's not an actual Yamaha OPL3, and the differences in sound are quite obvious when doing a direct comparison.

You can also post clips of certain games (say, the "Apogee fanfare" in Duke Nukem II, or the "Bootup" music in Ultima 6), and I will be able tell you, without you telling me, if it's the original OPL3 sound or the AWE's emulation of it, which has absolutely NOTHING to do with the Sound Blaster Live.

As for the two FM cores in the AdPLug Winamp plugin, Tatsuyuki Satoh's core, which seems to be the one DosBox uses, imitates the AWE sound, whereas Ken Silverman's core goes for the real OPL3 sound. Basically, Ken Silverman's core seems to be perfect except for the fact that it resets the Waveform position to zero every time a new note is started, which the real OPL3 doesn't do. This is most obvious in Ultima VI's "BRIT.M" and "DUNGEON.M" songs. Otherwise, it's perfect, as far as I can tell.

Reply 19 of 44, by jal

User metadata
Rank Oldbie
Rank
Oldbie

Here's two links describing capturing digital sound from the original AdLib: http://yehar.com/dsp/adlib/ads.pdf,
http://www.cc.jyu.fi/~jrop/specials/digisnap/.

Iirc (but I may well not), the AWE64 has built-in OPL3 circuitry, equal to many OPL clone chips around. I'd find it hard to believe they would actually emulate something they could build easily in hardware. Whether it sounds different from the real OPL3, I cannot tell (I've never owned an AWE64). However, differences may also be accounted for by the fact the OPL signals are fed to the DSP (making it possible to use echo and such). It may also be possible to directly get the digitial output from the SPDIF, thus facilitating emulation (easier than the hack described above). Again, all iirc, so don't get mad if I'm wrong.

As a counter argument, at least two links seem to support the emulation theory: http://queststudios.com/smf/index.php?topic=1816.msg18335, describing the advantage of the AWE32 over the 64 as having a real OPL3, and Re: dsp 4.13 hang notes bug - any kind of test needed.... Either way, current DOSbox OPL emulation is off, and should be fixed some day, imho.

JAL