back to list

Soundcard accuracy (was Re: Reaktor or Csound)

🔗graham@microtonal.co.uk

1/11/2001 7:58:00 AM

In-Reply-To: <007401c07b88$09d69380$137c69d5@e0b9e6>
Robert Walker wrote:

> You may find the relative pitch is better than absolute pitch.

Indeed. This isn't unique to soundcards. I think I remember adjusting my
TX81Z's global tuning a couple of steps to get it in line with A440.

> Here are my results for my sound card as an example (repeated from an
> earli=
> er post):

What card are you using?

> I've shown my one is overall sharp by 2 2/3 cents in absolute pitch, but
> relative pitch is correct to within about 0.2 cents.

I had previously concluded my AWE64 to tune in 1 cent steps, using all the
bits of the pitch bend to decide which step. You can do this by playing
two notes 1 semitone apart on different channels, and moving the higher
note down that 1 semitone with a pitch bend. Move the pitch wheel up or
down (this may have to be done by keying into a sequencer rather than
moving a real wheel) until you start to hear beating. Repeat for other
notes.

I never worked out how accurate those cent steps were, but my ears tell me
that intervals that are supposed to be just do sound purer than intervals
that are supposed to be tempered. That should still only give 0.5 cent
accuracy, unless the internal tuning happens to fit JI.

So I'll also ask what intervals you're trying to tune.

Hold on, I see the figures Dimitris got second time round work out at a
third accurate to 0.1 cents. So, what soundcard is this? Hold on again,
he says so further back! An AVM Apex. Interesting.

> The method I used was to actually count number of waves in Goldwave.
> (My soundcard has two synths, one of which producew regular waves for
> some =
> voices,
> which are easy to count, and one which produces the more lifelike ones
> that=
> are
> much harder to count since the wave shape varies so much as the note
> continues. so this is for the basic synth).

Can you load your own samples onto the better one? In that case you can
put some simple waveforms on. Or try things like "sawtooth lead" or
"synth bass" after turning vibrato and chorus off.

One problem with this kind of method is that you can get illusory JI
because of the integer number of samples. But your detail shows you've
avoided that kind of thing. What you haven't mentioned, though, is how
quickly the wave was passing the zero line. A square or sawtooth will
give you a high gradient that can give good results.

<experimental method snipped>

> Anyone got any ideas why relative pitch of a soundcard would be so much
> mor=
> e accurate than
> absolute pitch?
>
> Or is it the old trend of notes getting sharper at any opportunity!

Probably that nobody takes the A440 standard that seriously. I think
there may well be a tendency to tune sharp. The MIDI Fine Tune parameter
could be used to correct for this.

For a sample-based synth, it may well be that the samples are being
assigned the wrong frequencies. You don't even need the waveform to check
this. Take the length of the loop, and see if it's a multiple of the
supposed period.

Graham

🔗Robert Walker <robert_walker@rcwalker.freeserve.co.uk>

1/12/2001 7:55:41 AM

Todd Wilcox wrote:
> Well, to answer the second question first: I'm only guessing, but I'm pretty
> certain that the overall pitch of a typical sound card synthesiser will be
> based on the oscillations of a quartz crystal. Another possible source for
> timing (and maybe more likley cause it would be cheaper) would simply be
> dividing the bus clock (about 8 MHz for ISA and 33 MHz for PCI). I wouldn't
> be surprised if there were slight variations in both timing sources from
> computer to computer.

I've done a web search - at least some soundcards use quartz crystal oscillations
(do they all?)

Also, the drift of the quartz oscillators of soundcards relative to each other can
cause problems in combining tracks from two soundcards:
http://www.hitsquad.com/smm/news/261/#4.b
(see 4.b)

However, my result of a frequency of 640.984552 instead of 640 corresponds to a drift of
0.984552/640 seconds per second, or 24*60*0.984552/640 = 2.215242 minutes per day.

That is far more than the seconds per month of a typical quartz oscillator in normal use.

What I'm measuring is the pitch as recorded to a waveform audio file, rather than the
pitch as produced from the speakers

So what seems most relevant is the drift of the p.c. clock relative to the soundcard.

If both used the same clock, then one wouldn't detect any drift at all when recording it
to waveform audio as the timestamps for the samples recorded would exactly match
the ones used to generate them.

P.c. clocks apparently can be much less accurate than digital clocks, because they are
warm, losing minutes per month. N.b. I keep mine at the correct time using one of the time keeping
services on the web - the one at Boulder Colorado in fact, and have just downloaded a great utility called
automachron that can do this automatically whenever you connect to the internet:
http://www.softseek.com/Utilities/Clocks_Alarms_and_Reminders/System_Time_Synchronizers/Review_5124_index.html

However minutes per month mean only seconds per day, so that isn't enough to explain the
discrepancy.

Another idea is that the Dos clock, used for the system time, _can_ be even more inaccurate, sometimes losing minutes a day,
as it is kept in time by another less accurate method, but one doesn't normally notice that on a home computeras it is reset
whenever one reboots.

It keeps time by counting "ticks". So it can easily miss a few (depending on how heavily one is using the p.c.), and when this
happens, it runs more slowly.

More about the DOS clock:
http://www.oak.ie/company/dosclock.htm

A program that records to waveform audio would quite possibly use the system time to generate
time stamps, and so perhaps time could be slowed down (recorded frequencies speeded up)
due to missing ticks in the DOS clock.

This time, the amount of the discrepancy is okay.

However, I've been checking mine against the clock at Boulder Colorado, and it isn't losing anything like
as much as minutes a day. So far, has kept time fine, certainly less than a second drift in several hours.

So I think my p.c. clock isn't missing many ticks.

Perhaps this only applies to older p.cs, or perhaps ones that are _really_ heavily used?

Anyway, on the data so far, it doesn't seem that this is the explanation in this particular case, though clock
drift is certainly something one needs to be aware of in some situations.

> As for the first question: I'm sure 99% of sound card owners are not
> concerned with the tuning of their sound card's build in synthesiser.

Yes, agreed, and I imagine the soundcard manufacturers could probably fix it
by automatically adjusting the absolute pitch by some feedback method,
if there was enough demand.

It is easy enough to compensate if necessary, so I imagine there isn't going to be much demand for it.

> An interesting experiment might be to see if the same sound card plays at a
> different overall pitch when installed in different computers, or even in
> the same computer with other hardware differences (other devices on the ISA
> bus, maybe).

Yes, if anyone wants to try the experiment.

Graham Breed wrote:

> What card are you using?

Soundblaster Live!

So I imagine it is not too unusual a degree of accuracy for a modern soundcard.

> So I'll also ask what intervals you're trying to tune.

No particular ones. I tested a number of notes, and found them
sharp by 2.66 cents with range of values of about 0.2 cents.

This was some time ago (it takes a while to measure a large number of notes by
counting waves by hand).

> One problem with this kind of method is that you can get illusory JI
> because of the integer number of samples. But your detail shows you've
> avoided that kind of thing. What you haven't mentioned, though, is how
> quickly the wave was passing the zero line. A square or sawtooth will
> give you a high gradient that can give good results.

The waves were easy to measure as I expanded view until one could see
the individual sample steps. Also for the basic synth, there is only one
crossing point per wave.

The waves were easy to measure as I expanded view until one could see
the individual sample steps.

Also as I counted more and more waves in a wave, the calculated frequencies slowly converged.

So I think the method is a good one.

I've just discovered the drop list in CoolEdit next to FFT size, and the Triangular
option, which gives more accurate frequency measurements than the default
of Welch (Gaussian).

This seems to work fairly well, and gives roughly similar results. At 440 Hz, it shows a range of
values of about +-0.1 cents depending where I click on the wave).

Used it to test ascending scales in 200-tet. It suggests an accuracy of 0.5 cents
for my soundcard instead of 0.2 cents.

I could have been lucky in the choice of notes to test before - only did a small sample of about eight or so
as it takes a while to do them by hand.

The "Triangular" option is reasonably consistent with the wave counting method over most of the range.

However it seems to give results that are too flat for low frequency notes such as 110 Hz.

Example,

110 Hz

4 / 0.036312 110.156 Hz
16 / 0.14531 110.109 Hz
64 / 0.58124 110.109 Hz
256 / 256 / 2.32493 110.1108 Hz

N.B. this is sharp by 1.7429 cents instead of 2.66 cents as it is in middle of range, suggesting the
Midi synth on the soundcard may be slightly flatter for low notes.

For this note, CoolEdit gives the frequency as various values from 109.91 to 109.99 Hz

I'm fairly confident in this calculation in Goldwave.

> Can you load your own samples onto the better one? In that case you can
> put some simple waveforms on. Or try things like "sawtooth lead" or
> "synth bass" after turning vibrato and chorus off.

With the better synth, CoolEdit shows a range of values from 438 to 442 Hz, and the sample repeats
every 0.8 seconds. (this is for recorder voice).

Similar fluctuations for sawtooth, which is a very complex waveform on the more realistic synth. With occasional
maverick values shown such as 1320.5 Hz, (probably due to multiple peaks in the waveform).

The fluctuations are too large to tell if the better synth is in pitch or not.

These aren't really large fluctuations - + - 2 Hz is +-7.8514 cents

Not much hope of counting these waves in Goldwave, as you get varying numbers of subsidiary peaks for
each wave, all varying in strength, sometimes with double peaks, and so on.

Probably best method to check pitch of the better synth would be to load ones own samples, as you say.
Soundblaster Live! has soundfonts which one can create oneself I believe. - I haven't needed to do that yet,
but one could give it a try.

> Probably that nobody takes the A440 standard that seriously. I think
there may well be a tendency to tune sharp. The MIDI Fine Tune parameter
could be used to correct for this.

Maybe that's it...

Robert