Adding Sound Effects

Author(s): Tim Hartnell
Publication: The Plotter
Pub Details: The Plotter v2 n12 (Volume 2, Issue 12)
Pages: 5-6

There’s a good chance that you are interested in playing games on your Timex Sinclair. Can the computer give the added dimension of sound to games? Can it make sounds like phasors firing, footsteps or train noises? The answer is both Yes and No. It can produce some fairly useful noises which will enhance your games.

However, if you expect the sounds to be as good as those produced by arcade machines, I’m afraid you’ll be a little disappointed.

PHASOR FIRE, PHASOR FIRE 2 and PHASOR 3 give three ways of making a suitable sound for a space shooting game, and WALKING shows how you can incoporate sound with movement. Note that the first graphics character in line 140 is an L, the second is a K.

PHASOR FIRE

10 REM PHASOR FIRE
20 LET D=0.0125
30 FOR X=1 TO 2
40 FOR Y=4 TO 16 STEP 2
50 BEEP D,Y
60 NEXT Y
70 NEXT X
10 REM PHASOR FIRE 2
20 FOR X=-10 TO 0
30 BEEP 0.0125,X
40 NEXT X
50 FOR Y=0 TO -5 STEP -1
60 BEEP 0.0125,Y
70 NEXT Y
10 REM PHASOR 3
20 FOR X=5 TO 20 STEP 1.5
30 BEEP .008,X
40 NEXT X
50 FOR Y=20 TO 5 STEP -1.5
60 BEEP .008,Y
70 NEXT Y
80 PAUSE 30
90 RUN
 10 REM WALKING
20 FOR A=0 TO 7
30 READ X
40 POKE USR "L"+A,X
50 NEXT A
60 FOR A=0 TO 7
70 READ X
80 POKE USR "K"+A,X
90 NEXT A
100 FOR T=0 TO 31
110 PRINT AT 21,T;"'";
120 NEXT T
130 FOR C=0 TO 31
140 PRINT AT 20,C;"▒": PAUSE 3: PRINT AT 20,C;"▒": PAUSE 3: PRINT AT 20,C;" "
150 BEEP 0.02,30: BEEP 0.02,40
160 NEXT C
170 GO TO 100
180 REM DATA FOR 2 VERSIONS OF MAN
190 DATA 24,36,153,126,24,100,132,4,24,36,153,126,24,38,33,32
200 STOP

Another useful routine is the program which simulates a bomb drop. This makes the frequency of the note fall from around the highest pitch available to one some 20 semitones lower. The rate of fall is fast at first, but gets even faster to give the impression of the bomb speeding up as it gets closer to the ground.

BOMB

10 REM BOMB
20 FOR X=69 TO 55 STEP -0.3
30 BEEP 0.05,X
40 NEXT X
50 FOR Y=0 TO 20
60 BEEP 0.01,-10: BEEP 0.01,-50: BEEP 0,01,-60
70 NEXT Y

FROM:THE TIMEX SINCLAIR 2068 EXPLORED BY TIM HARTNELL

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.