Touch-Tone(R) Dialer for your Atari

by Tom Hudson


When the Atari computers' sound capabilities are being discussed, most people automatically think of the explosion and "zap" sounds common in game programs. Actually, these sound effects barely scratch the surface of the sound generation capabilities of Atari computers.

One example of the amazing things possible which Atari sound is SAM, the Software Automatic Mouth, from Don't Ask Software. SAM is a program which makes it possible for your computer to talk without any additional hardware. Although SAM has a couple of drawbacks, it is one practical use of the heretofore game-bound sound channels.

Phone fun.

Another interesting use of the Atari sound generation system is the generation of Touch-Tone(R) frequencies.

Touch-Tone(R) is the trademark for the "beep" sounds used in most push-button telephones. Every time you push one of the keys on a Touch-Tone(R) telephone, the phone generates two separate pitches, or frequencies. Figure 1 shows the standard TouchTone(R) keyboard, along with the seven frequencies used.

Figure 1
 120913361477
697123
770456
852789
941*0#

If you look at Figure 1, you will see that there is a frequency for each column of numbers, and one for each row. All frequencies are in hertz, or cycles per second. When you press a key, the frequencies for that column and row are sent out over the phone line to the phone company's switching equipment, which converts the tones back into the proper digit. If you press the number 6, for example, the frequencies 770 and 1477 hertz are selected. If you press 7, the phone sends the frequencies 852 and 1209 hertz.

What most people don't know is that these tones don't have to come from the telephone itself. If you're an extremely talented whistler, you could dial a number simply by whistling seven tones!

Fortunately for us non-whistlers, the Atari computer can be commanded to produce the frequencies needed by the phone system. By sending out the proper combinations, we can dial the phone simply by holding the handset up to the television speaker. This will work with any phone on a Touch-Tone(R) system, even rotary-dial phones. Just be sure your local exchange can handle Touch-Tone(R) codes.

Preliminary work.

In order for the computer to simulate the TouchTone(R) frequency system, it must send out two separate frequencies. This is no problem, since the Atari computers feature four independent sound channels. For our purposes, we'll use channels 1 and 2.

Next, we have to determine how to get the frequencies we want. The number necessary in the Atari BASIC SOUND command to produce a specific frequency can be found by the following formula:

PITCH # = ( 63910 / FREQ ) / 2

Using this formula for all seven of the Touch-Tone(R) frequencies, we come up with the following table:

TOUCH-TONE
FREQUENCY
PITCH #ATARI
FREQUENCY
697 HZ. 46695 HZ.
770 HZ. 42761 HZ.
852 HZ. 38841 HZ.
941 HZ. 34940 HZ.
1209 HZ.261229 HZ.
1336 HZ.241332 HZ.
1477 HZ.221453 HZ.

With tone frequencies in hand, we're now ready to write our Touch-Tone(R) program.

What do you do with it?

Some of our more practical readers are probably asking, "What in the world is this program good for?"

First, you could store frequently-used phone numbers on disk and write a program to recall them when needed. This could be particularly good for a severely handicapped individual. The good part is that the program works even with rotary equipment, as long as your local phone company supports Touch-Tone(R).

Second, some of the "cheap" long-distance services, such as MCI, require you to enter a personal access code. If you don't have Touch-Tone(R) equipment, you can't do this. Radio Shack sells a small Touch-Tone(R) "beeper" unit ($24.95) for this purpose. Is typing this program worth it? You be the judge.

Lastly, this program makes a nice demonstration of some of the odd things your computer can be used for, especially if somebody says the Atari is "just a game machine." If you belong to an Atari user group, get up on stage and let them know what this little machine can do. Some of them may have more applications for this program, and we'd like to hear about them.

BASIC Listing
10 REM **************************
20 REM * TOUCH-TONE (TM) DIALER *
30 REM *                        *
40 REM *     BY: TOM HUDSON     *
50 REM *  ANALOG COMPUTING #19  *
60 REM **************************
70 REM *** SET UP ARRAYS ***
80 DIM F1(11),F2(11),PN$(20)
90 REM *** LOAD FREQUENCY DATA ***
100 FOR X=0 TO 11:READ A,B:F1(X)=A:F2(
X)=B:NEXT X
110 REM *** GET PHONE # TO DIAL ***
120 PRINT "ENTER NUMBER TO DIAL"
130 INPUT PN$:TRAP 120
140 REM *** NOW DIAL IT! ***
150 FOR X=1 TO LEN(PN$)
160 REM *** IS IT *? ***
170 IF PN$(X,X)="*" THEN N=10:GOTO 220
180 REM *** IS IT #? ***
190 IF PN$(X,X)="#" THEN N=11:GOTO 220
200 REM *** GET DIGIT OF NUMBER ***
210 N=VAL(PN$(X,X))
220 REM *** NOW START BOTH TONES! ***
230 SOUND 1,F1(N),10,4:SOUND 2,F2(N),1
0,4
240 REM *** LEAVE TONE ON A MOMENT ***
250 FOR D=1 TO 40:NEXT D
260 REM *** NOW TURN TONES OFF ***
270 SOUND 1,0,0,0:SOUND 2,0,0,0
280 REM *** LEAVE OFF A MOMENT ***
290 FOR D=1 TO 20:NEXT D
300 REM *** NOW DO NEXT DIGIT! ***
310 NEXT X
320 REM *** ALL DONE, GET NEW # ***
330 GOTO 120
340 REM *** TONE DATA ***
350 DATA 23,34
360 DATA 26,46
370 DATA 24,46
380 DATA 22,46
390 DATA 26,42
400 DATA 24,42
410 DATA 22,42
420 DATA 26,38
430 DATA 24,38
440 DATA 22,38
450 DATA 26,34
460 DATA 22,34
Checksum Data
10 DATA 280,408,804,862,182,290,812,39
2,478,326,189,345,132,638,929,7067
160 DATA 945,487,937,489,266,715,989,8
75,649,125,655,995,498,133,499,9257
310 DATA 765,93,702,232,747,767,764,76
1,764,733,730,761,758,755,758,10090
460 DATA 749,749

Previous | Contents | Next

Original text copyright 1984 by ANALOG Computing. Reprinted with permission by the Digital ANALOG Archive.