From: "sander schimmelpenninck" <sander.schimmelpenninck@canrem.com>
Subject: computer as tone gen
Reply-To: "sander schimmelpenninck" <sander.schimmelpenninck@canrem.com>
Organization: Canada Remote Systems
Distribution: rec
Date: 22 Dec 92 14:54:11 EST

This note describes how you can use your computer as an accurate
audio-tone sweep generator to tune musical instruments and check
the frequency of a digital shortwave receiver.
    BACKGROUND
With BASIC you can generate an audio tone as follows:
SOUND,1000,50. That will give a 1,000-Hz tone lasting a few
seconds.
    Marc Cormier wrote the following BASIC program:
10 cls
20 KEY(11) ON: KEY(14) ON: KEY(1) ON
30 INPUT "Frequency in Hz";X
40 INPUT "Increments in Hz";Y
50 PRINT "To end press F1"
60 IF X<37 OR X>30000 THEN PRINT "Frequency limit": END
70 SOUND X,1 : LOCATE 10,1 : PRINT X
80 ON KEY(11) GOSUB 120
90 ON KEY(14) GOSUB 140
100 ON KEY(1) GOSUB 160
110 GOTO 60
120 X=X+Y
130 RETURN 60
140 X=X-Y
150 RETURN 60
160 END
    To invoke this program from the DOS prompt, enter BASIC
C:\UTIL\TONEGEN. For BASIC substitute the name of your BASIC
version. For UTIL substitute the subdirectory where you keep
utilities.
    Enter the starting frequencies as prompted. Then use the up
and down keys to sweep up and down by the increment you
specified.
    Hit F1 when done, F2 to run the program again, or enter
SYSTEM to exit to DOS.
ACCURACY
    National Institute of Technology station WWV broadcasts tones
of 500, 600, and occasionally 440 Hz (middle A). Its frequencies are
2.5, 5, 10, 15, and 20 MHz. This allows to verify your tone
generator.
CHECKING A SHORTWAVE SET
    Here is how I check the frequency of my receiver, which tunes
in 100-Hz steps:
    Go to upper sideband.
    Tune 300 Hz below a WWV signal when the station is sending
second ticks only. If my receiver were perfect, I would get a 300-
Hz tone.
    Produce a 300-Hz tone on the computer. Sweep up and down
until the radio and the computer produce the same tone.
    With my radio the tones are the same when my computer
produces a 260-Hz tone. That means the frequency readout on my
radio is 40 Hz high.
CHECKING A TRANSMITTER
    I measured the frequency of my CB as follows:
    Select Channel 13, which is 27,115 MHz.
    Tune shortwave set to 27,114.7 MHz.
    Desensitize shortwave set by removing external antenna and
cranking RF gain down.
    Depress microphone button.
    Sweep generator until the two tones are identical.
    With my CB that happens when the tones are both 290 Hz. That
would suggest my CB is 10 Hz high. But my shortwave set is 40 Hz
high. Thus my CB is actually 30 Hz low.
TUNING A STRING INSTRUMENT
    To tune a string instrument, you need to know the nominal
frequencies.
BRACKETING
    The methods described use zero-beating. When two slightly
tones are present, they produce a third one called a heterodyne.
One easy way to determine zero beat is to tune the generator to
one side of the signal until a wobble of, say, five Hz results, and
then to the other side for the same wobble. You then take the
average of the two tones.
CREDIT
    Marc Cormier deserves 99% of the credit for this utility. He
wrote the program in response to my query on a bulletin board.
...
    Comments invited.
    Sander Schimmelpenninck
--
Canada Remote Systems  - Toronto, Ontario
World's Largest PCBOARD System - 416-629-7000/629-7044