Commodore 16 User Manual
Download Operation & user’s manual of Commodore 16 Desktop for Free or View it Online on All-Guides.com.
Ill
II III 41 III
II I
NOTE A B
C
D
E F G
VALUE 770 798 810 834 854 864 881
ACTUAL FREQUENCY
440.4
494.8
522.7 588.7 658 699 782.2
(HZ)
Try
the Wowing program:
sets VOLume
NEW
10 VOL 8
-<—
20
X
-0
30 DO
40 SOUND l.X.5 « plays nole
50 X
=
X + S
60 LOOP UNTIL X
-
1015
70 VOL -* turns off VOLume
80 END
This program
shows
of
some ol your Commodore '6's musical range.
The third number after
the
word
SOUND controls the Duration (length)
ol the note This tells your computer how long to play
the note. This
number
can be anything Irom
to 65535.
This
number sets a timer,
86
I
!
f
!
(
(
(
f
I
(
(
f
I
which counts
time
in sixtieths of
a
second A duration of
60
keeps the
note on lor one second The rule ol thumb lor duration is the
larger
the
number, Ihe longer the note stays on. In tact, II you use 65535. the
nole
stays on lor over 16 minutes. To turn a sound
off,
use a zero
duration,
which does not
allow
Ihe
sound
to be
produced.
A Musical Sound Effect
Sound
effects can
be created
using
either musical
tones
or
noise.
Comb>nmg simple BASIC programs ana sound commands can
generate unusual and entertaining effects. For
instance,
Ihe FOR
NEXT . STEP loop can be used creatively In sound eflects.
This
command sets up
a
loop; each time the
computer
reads FOR, It
changes the
counter
variable (S
in
this
example). When
it
reads NEXT.
It goes back to
the FOR statement. This program uses a FOR
NEXT loop with a negative STEP,
to
count down
from
a high
number
lo
a
lower
one
by 25
at
a
time
10
VOL 8
sets VOLume
at 8
20 FOR S= 1000 TO
700 STEP
-25
30 SOUND 1, S, 1
40 NEXT S
creates loop, with
downward
STEPs
Type
RUN ano press return to
near
the
sound effect,
The
key is line
20.
which
selects a
number range from 1 000 to 700 going down the
scale. STEPping down 25 numbers at
a
time Finally, line 30
instructs
your
Commodore 16
to play each
note lor
(us: an
instanl
by
selttng the
DURATION
to 1 ,
which
is
1
/60 ol a second.
Experimenting with
different number and duration values can give
you
some very
interesting effects.
Creating a Noise Sound Effect
Using
a
value ol 3 when selecting
a
voice in the SOUND
command
spc-cilies noise. This is used lo create
sound effects with noise rather
than tone.
The
following program
uses
voice
3 lo
create the sounds ol
a
windstorm.
10 VOL 2
-«
sets VOLume level
20 R-INTIRND{0)-10) + 1
<
selects RaNDom number Irom
1
30FORX
=
1TOR to
10
40 SOUND
3,
600+ 30*X, 10
{continued on next page)
87