VOGONS


OPL recording problem

Topic actions

Reply 20 of 51, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie

CT1747 (Non-EMU8000-based cards)
Pin 001 - OSC Input (from 14.31818 crystal, through 74LS04)
Pin 080 - ??? (tied to GND)
Pin 098 - Data Output (to DAC)
Pin 099 - Bit Clock Output (to DAC)
Pin 100 - Word Select Output (to DAC)

CT1747 (EMU8000-based cards)
Pin 001 - OSC Input (from EMU8000 pin 30)
Pin 080 - ??? (from(?) EMU8000 pin 31)
Pin 098 - Data Output (to EMU8000 pin 29)
Pin 099 - Bit Clock Output (to EMU8000 pin 28)
Pin 100 - Word Select Output (to EMU8000 pin 27)

EMU8000
Pin 027 - Word Clock Input
Pin 028 - Bit Clock Input
Pin 029 - Data Input
Pin 030 - OSC Output
Pin 031 - ???
Pin 078 - Bit Clock Output (to DAC)
Pin 080 - Data Output (to DAC)
Pin 081 - Word Select Output (to DAC)

So, who has a frequency counter? jwt27? 😀

Reply 22 of 51, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie
sklawz wrote:

The I2S word clock is ~49.7 Khz pin 100 on a CT2760 REV. 3

Nice. I hadn't expected that. 😀

Is there any chance that you can measure the frequency at pin 1 of the CT1747 as well?

Reply 23 of 51, by jwt27

User metadata
Rank Oldbie
Rank
Oldbie
Cloudschatze wrote:

So, who has a frequency counter? jwt27? 😀

Nope, sorry. For audio-frequency measurements I always use Visual Analyzer, but of course you could use this to measure higher digital frequencies too, if you run the signal through a divider first.

(edit: Reading my own words again, I am actually saying I DO have a frequency counter 🤣. In any case, I don't have any (working) AWE cards to test.)

I just had a look at the YMF719 again with this program, here is an A5 note played in Adlib Tracker:

wvt8.png

As you can see, it's not exactly 440Hz. So unless adtrack2 uses some non-standard tuning system, I think this proves that the OPL3-SAx does not compensate for the lower sampling rate, and will thus sound slightly detuned. I would've expected a difference of -7 cents (438.2Hz) here though... Will have to check the sampling rate again, as I measured that on a different card.

Last edited by jwt27 on 2014-02-05, 20:16. Edited 1 time in total.

Reply 24 of 51, by NewRisingSun

User metadata
Rank Oldbie
Rank
Oldbie

The difference is too big to be caused solely by the sampling rate difference. According to my calculations, the difference between a YMF289/YMF278/YMF719 and an original OPL2/OPL3 should be (49,715+10/11)/(49,515+15/19)=1.004041531385281... ~ 0.4 %, which would detune 440 Hz to ~438.2289 Hz, but not 436 Hz.

Try this .COM file. It will play a sine wave at exactly (or as close as the OPL allows it) 440 Hz.

Attachments

  • Filename
    OPL440.zip
    File size
    243 Bytes
    Downloads
    98 downloads
    File license
    Fair use/fair dealing exception
Last edited by NewRisingSun on 2014-02-05, 19:39. Edited 1 time in total.

Reply 25 of 51, by jwt27

User metadata
Rank Oldbie
Rank
Oldbie
NewRisingSun wrote:

The difference is too big to be caused solely by the sampling rate difference. According to my calculations, the difference between a YMF289/YMF278/YMF719 and an original OPL2/OPL3 should be (49,715+10/11)/(49,515+15/19)=1.004041531385281... ~ 0.4 %, which would detune 440 Hz to ~438.2289 Hz, but not 436 Hz.

Try this .COM file. It will play a sine wave at exactly (or as close as the OPL allows it) 440 Hz.

Thanks, it's measuring right now. Takes a LOT of cpu time on a Pentium 4 🤣

edit: somehow your program produces a much more stable frequency, and as a result the histogram looks entirely different. Perhaps your 440Hz is closer to a round number of samples? I just turned the FFT size up a bit and restarted to make sure I'm not seeing any measurement errors.

Reply 29 of 51, by jwt27

User metadata
Rank Oldbie
Rank
Oldbie

Alright, here's the result from your second program:

wnkv.png

It's not exactly 438.2289Hz, but very close. Still, this shows that the YMF719 does not compensate at all for the change in sampling rate.
Now I wonder why my first graph looks so completely different. Either adrack2 does some weird things, or I made a mistake somewhere. I'll try measuring it again.

Reply 30 of 51, by NewRisingSun

User metadata
Rank Oldbie
Rank
Oldbie

That's not correct --- it does compensate, just not perfectly. If it did not compensate at all --- meaning if it used the same dividers --- 440 Hz would be played at 440 Hz*44100/(49,715+10/11)=390+186/625 Hz. But I am glad that my (and your) calculations seem to have correctly predicted the result. Now to find out what is up with the CT1747 when it is connected to the EMU8000.

And that is a very weird-looking histogram for showing a bimodal distribution.

Reply 31 of 51, by jwt27

User metadata
Rank Oldbie
Rank
Oldbie
NewRisingSun wrote:

That's not correct --- it does compensate, just not perfectly. If it did not compensate at all --- meaning if it used the same dividers --- 440 Hz would be played at 440*44100/(49,715+10/11)=390.2976 Hz.

And that is a very weird-looking histogram for showing a bimodal distribution.

Ah yes, you're right of course. I shouldn't have said "at all" there.

About the graph, I only have 420 sample points here, it would probably look a bit nicer if I let it run all day... or bought a faster PC. Still, the displayed mean value should be accurate enough.

Reply 32 of 51, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie

adtrack2 uses 0x241 or 577 in decimal as FNUM for A note, so it's off a bit. Your OPL440 utility uses the best value 580 for 14.318180 MHz clock (which by NTSC definition is not fractional, but the error is so small it does not matter).

Please note that crystals or oscillators used in consumer sound cards may not be the most accurate, so expect +/- 100 PPM error range. What's worse if the clock is built with separate inverter and regular crystal, the circuitry may not be optimal and it will pull the frequency.

I have one SB with onboard 14.318MHz crystal and the YMF262 sampling frequency is 49707 or about -180 PPM error.
I also have one Aztech sound card, and the crystal is not even 14.318MHz but something a bit higher very near it.

Hmm, maybe the bimodal distribution comes from some kind of digital sampling rate conversion, as the FNUM is calculated in the datasheet as if the sampling rate were 49518, while samples are output at 44100? Could it just drop samples? Or could there be some fractional divider in the chain?

Reply 33 of 51, by NewRisingSun

User metadata
Rank Oldbie
Rank
Oldbie

14.318180 MHz clock (which by NTSC definition is not fractional

What do you mean? That the crystals used in sound cards do not output the mathematically ideal frequency (agree), or that ideal NTSC frequencies are irrational numbers (disagree)?

Hmm, maybe the bimodal distribution comes from some kind of digital sampling rate conversion, as the FNUM is calculated in the datasheet as if the sampling rate were 49518, while samples are output at 44100? Could it just drop samples?

That would produce horrendous artifacts. It is far more likely that given the 33,868,800 Hz master clock, the Envelope Generator, Phase Generator and Low-Frequency Oscillators use a divider of 684 while everything else uses a divider of 768.

I think it is more a problem of the histogram-producing algorithm than anything else.

Last edited by NewRisingSun on 2014-02-05, 21:10. Edited 1 time in total.

Reply 34 of 51, by jwt27

User metadata
Rank Oldbie
Rank
Oldbie
Jepael wrote:

Hmm, maybe the bimodal distribution comes from some kind of digital sampling rate conversion, as the FNUM is calculated in the datasheet as if the sampling rate were 49518, while samples are output at 44100? Could it just drop samples? Or could there be some fractional divider in the chain?

I think it's because 440, or rather 438.2289Hz is not a round number of samples, so it's "switching" between two different frequencies every other period. I'm running the same measurement on 3094.75Hz now (F-NUM 0x1E00, 16 samples long) and it's starting to look more like a gaussian distribution.

Also found out why my first histogram looks so different. I turned down the modulator "output level" to 0 in adtrack2, which of course does not disable frequency modulation completely.

Reply 35 of 51, by sklawz

User metadata
Rank Member
Rank
Member

lo

Cloudschatze wrote:
sklawz wrote:

The I2S word clock is ~49.7 Khz pin 100 on a CT2760 REV. 3

Nice. I hadn't expected that. 😀

Is there any chance that you can measure the frequency at pin 1 of the CT1747 as well?

it's 14.33 MHz.

bye-bye

Reply 37 of 51, by sklawz

User metadata
Rank Member
Rank
Member

Hi

Cloudschatze wrote:
sklawz wrote:

it's 14.33 MHz.

Thanks-much.

So, the EMU8000 is doing non-integer frequency division - something else I'd thought improbable. Go figure. 😵

The frequency is most likely 14,318,181 as anticipated. Where it comes
from is unknown, the track disappears under the 8-bit bus transceiver.

The counter I used isn't particularly accurate at that frequency, it was
a WHITEGOLD WG020. Basically a cheap multi-meter with a frequency
option. My scope (bitscope) isn't so hot at that frequency either but
I could stick a probe in somehow, but it isn't all that easy to do in my case.

Bye-bye

Reply 38 of 51, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie
sklawz wrote:

The frequency is most likely 14,318,181 as anticipated. Where it comes
from is unknown, the track disappears under the 8-bit bus transceiver.

It comes from pin 30 on the EMU8000.

Reply 39 of 51, by sklawz

User metadata
Rank Member
Rank
Member

Hi

Does the ISA OSC signal enter the EMU8000? We may speculate that
the EMU syncs it's clocks to this signal also and regenerates it for
the YMF262 embedded in the CT1747? You need more information.

Bye-bye

UPDATE: From inspection B30 is not connected and OSC doesn't enter
the board.