VOGONS


FM OPL3 frequency differences

Topic actions

Reply 80 of 84, by Ace

User metadata
Rank Oldbie
Rank
Oldbie
Great Hierophant wrote:

I believe you can disable the SB Pro's low-pass filter in the MIXERSET program.

Only for digital audio. The filter is permanent on the FM output.

Creator of The Many Sounds of:, a collection of various DOS games played using different sound cards.

Reply 81 of 84, by Eep386

User metadata
Rank Member
Rank
Member

Sorry to bump this old thread, but I hadn't realized that the edits I made way-back-when on that Wikipedia page on the YMF262 would cause this kind of a stir someplace. Allow me to explain myself.

First off, I suppose I should explain what I was trying to do with the Wikipedia recordings. My aim with those was to show the minute differences in output between the chip (and especially the much more obvious difference between the Yamaha chips and the ESS clone chip), and I simply felt MELT.AMD was particularly good at bringing out the audible differences between them. TBH it's a bit difficult to do a 100% on-the-level comparison, considering that the two cards I used to make the YMF262 vs. YMF289 comparisons were indeed different. Both were captured from Sound Blaster 16s, one a CT2230 with a CT1747 (which incorporates a YMF262 FM core) and the other a CT2910 (my favorite YMF289 card). It's far from scientific, but it was adequate for the task, though in hindsight I really could have done something about the high noise level of the recordings...

Secondly, before my edits Wikipedia had a mere stub for the YMF289. I had originally filled out the YMF289 article as well as I could using a datasheet, but then later decided to merge it with the YMF262 article anyway as they're still functionally the same chip despite some very minor differences in register behavior and some more obvious differences in output stage and sample rate.

I always make every effort to update any incorrect information I post, once I learn more. I did speculate in a few parts, notably in the presumption about why I felt the YMF289 uses a lower sample rate. After reading through the discussions over the input clock crystal differences, I've removed that bit of speculation, as the clock crystal differences present a more plausible explanation. (I'd reckon a more 'standard' frequency oscillator would indeed be cheaper to purchase in large quantities than a less-standard custom frequency.)

Tertz wrote:

Lower pitch of 289 in the comparision sample on that article. What makes the sound noticably worse.

Tertz wrote:

If it has music examples of real output made on those chips, then it's meaningful.

To be honest, whether or not YMF289 is really 'worse' depends on your POV. If you're accustomed to listening to 'genuine' YMF262 then the YMF289 will probably sound ever so slightly different from what you'd remember; namely, more squeaky from resampling artifacts. As for me, my first sound card was a YMF719 which used the YMF289 FM core, so to me the YMF289/YMF71x/YMF7x4 sounds exactly how I remember DOS games sounding as a child. Hence, for me it's the 'best'. However, that said, YMF262 doesn't have resampling artifacts, making songs like MELT.AMD that do a lot of high-frequency stuff sound more pleasant to listen to, so I like to have both whenever possible.

My ears are weird, despite having some tinnitus I can definitely hear the subtle difference in pitch between the two in this song, and I had initially heard the difference when I wasn't even looking for it. (I was actually listening for grounding loop racket, when the difference caught my ear...) A friend of mine also heard a difference in pitch as well (he's a musician and an extreme synthesizer fan to boot), but in either case it wasn't really that significant. Ergo why I mentioned that the difference in pitch was subtle, as I doubt many would hear it in the 'normal' course of DOS gameplay.

Life isn't long enough to re-enable every hidden option in every BIOS on every board... 🙁

Reply 82 of 84, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

Everyone states that the CT1747 uses a YMF-262 core. I am inclined to believe that, but the base frequency seems to be variable. On my Sound Blaster 16 CT2230, there are three crystals, a 14.3MHz, a 46.61512MHz and a 24MHz. On my Sound Blaster AWE32 CT2760, there is a 45.1584MHz crystal and no 14.3MHz crystal. The OSC pin is not present on either card.

So on the AWE32 card, if we assume that the 45MHz crystal is being used, a 908 divider would give a base frequency of 49.733KHz. But I recall that there must be resampling at least at the SPDIF connector, which outputs at 44,100KHz. But on the CT2280, there is no reason why the base frequency can't be 49.716KHz.

Ace wrote:
Great Hierophant wrote:

I believe you can disable the SB Pro's low-pass filter in the MIXERSET program.

Only for digital audio. The filter is permanent on the FM output.

This may not necessarily be a bad thing, there are cards like my PAS16 which do not have sufficient low-pass filtering on their FM and emit a high-pitched whine at reasonable listening levels.

http://nerdlypleasures.blogspot.com/ - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog

Reply 83 of 84, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie
Great Hierophant wrote:

Everyone states that the CT1747 uses a YMF-262 core. I am inclined to believe that, but the base frequency seems to be variable. On my Sound Blaster 16 CT2230, there are three crystals, a 14.3MHz, a 46.61512MHz and a 24MHz. On my Sound Blaster AWE32 CT2760, there is a 45.1584MHz crystal and no 14.3MHz crystal. The OSC pin is not present on either card.

So on the AWE32 card, if we assume that the 45MHz crystal is being used, a 908 divider would give a base frequency of 49.733KHz. But I recall that there must be resampling at least at the SPDIF connector, which outputs at 44,100KHz. But on the CT2280, there is no reason why the base frequency can't be 49.716KHz.

It may not be exactly YMF262 core, it might be one of the later cores, like the one in OPL3-SA3 or OPL4. These cores don't work with 14.318MHz clock but 33.8688 (or 16.9344) MHz, which is 44100*768 (or 44100*384), so they have 44.1kHz audio output. (It could be the same core but with just different clock divisor though). However the phase accumulators are said to run at 33.8688/684 or 49518 Hz, so the output gets resampled in the chip. I believe one japanese fellow has even figured out how the sampling rate conversion is done inside the chip. And as far as I know, there is no lookup table or compensation for the note values even if the internal sampling rate is different. The difference is not even 7 cents, but that may be noticeable to people with ability to distinguish 7 cents difference without reference tone, so requires person to have perfect pitch. When the rate is scaled in the chip it will scale everything identically so harmonics should sound identical as well. What might sound different then depends on sampling rate conversion (that might alter the pitch or create aliasing effects) and DAC itself and analog components after it (such as anti-alias filter or lack of it).

Great Hierophant wrote:

This may not necessarily be a bad thing, there are cards like my PAS16 which do not have sufficient low-pass filtering on their FM and emit a high-pitched whine at reasonable listening levels.

When is this high pitched whine heard? If it happens also when not playing FM, it might be some clock or power supply coupling to output audio. But DAC runs at 49716 Hz, it should not be heard by humans when it's silent (the output does not change so it's pure DC). When playing audio, the aliasing effects could be heard. But there happens also digital aliasing inside the chip so that can't be filtered out.

Some games leave the phase accumulators running, so even if the operator volume is turned all the way down and envelope generators decayed to silence, it will still toggle the each channel between +0 and -1 according to the selected waveform, so that might be heard as noise or static as well.

Reply 84 of 84, by MartinEmrich

User metadata
Rank Newbie
Rank
Newbie

Hello!

As this thread helped me with my problem, I post the solution here:

So I was bored, and I thought: "let's try to make the OPL3 FM synth in an old laptop playable with a MIDI keyboard".
It's a Toshiba Satellite Pro 490XCDT with a genuine Yamaha OPL3-SA2 (YMF711).
After some hacking, I got it working. But playing it along a guitar loop, it sounded awful!

I found out that the OPL3 sounds were out of tune, the A hat 436Hz instead of 440Hz. While probably unnoticeable for me alone, it was clearly noticeable together with other instruments.

In search for a cause, I found this thread, which helped me in the right direction.
The sound chip has no notion of notes or real frequencies, they must be calculated. And indeed, these numbers in the linux kernel driver were wrong.
After calculating the "right" numbers and patching the kernel, the old laptop plays (almost) perfectly in tune!

Here's the patch, in case anyone has the same issue...: https://github.com/MartinEmrich/linux-opl3-tuning-patch

Cheers,

Martin