Random Sounds - Commodore 128 System Manual

Hide thumbs Also See for 128:
Table of Contents

Advertisement

Here's a quick explanation of the program. Lines 10 and 20
PRINT the introductory messages on the screen. Lines 30
through 50 INPUT the voice, frequency and duration parameters.
Line 60 asks if you want to enter the optional SOUND
parameters, such as the sweep settings and waveform. If you
don't want to specify these parameters, press the " N" key and
the program jumps to line 130 and plays the sound. If you do
want to specify the optional SOUND settings, press the " Y " key
and the program continues with line 80. Lines 80 through 110
specify the sweep direction, minimum sweep frequency, sweep
step value and waveform. Line 120 INPUTS the pulse width of the
variable pulse waveform only if waveform 2 (variable pulse) is
selected. Finally, line 130 plays the SOUND according to the
parameters that you specified earlier in the program.
Line 140 asks if you want to hear the SOUND again. If you do,
press the "Y " key; otherwise, press the " N" key. Line 150 checks
to see if you pressed the "Y" key. If you did, program control is
returned to line 130 and the program plays the SOUND again. If
you do not press the " Y" key, the program continues with line
160, and the program reruns. To stop the Sound Player program,
press the RUN/STOP and RESTORE keys at the same time.

Random Sounds

The following program generates random sounds using the RND
function. Each SOUND parameter is calculated randomly. Type
the program into your computer, SAVE it and RUN it. This
program illustrates how many thousands of sounds you can
produce by specifying various combinations of the SOUND
parameters. Here's the listing:
10 P R IN T "VC
FRQ
20 PRINT "*
.......
30 V = INT
(RND
40 F = INT
(RND
50 D = INT
(RND
60 DIR = INT
(RND
70 M = I N T
(RND
80 S = INT
(RND
90 W = I N T
(RND
100 P = INT
(RND
110
PRINT V; F ; DIR ;M ; S ;W ; P : P R I N T : P R I N T
120 SOUND V , F , D , D I R , M , S ,W,P
130 SLEEP 4
140 SOUND V , 0 , 0 rD I R, 0 , 0 ,W,P
150 G OT O 10
DIR
MIN
(1)*3)+1
(1)*65535)
(1)*240)
(1)*3)
(I )*65535)
(1)*32767)
(1)*4)
(1)*4095)
SV
WF
PW
"
: REM V OI C E
: RE M F R E Q U E N C Y
: R E M D U R A T I O N
: RE M STEP D I R E C T I O N
: REM M I N I M U M F R E Q U E N C Y
: REM STEP V A L U E
: REM W A V E F O R M
: R E M PULSE W I D T H
: RE M D I S P L A Y V A LU E S
: REM PLAY SOUND
: REM W A I T A BIT
: REM S WITCH
VOL 5
S OUND OFF
7-9

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents