Chapter
7:
Sound 233
THE
COMPONENTS
OF
SOUND
Pure
Tones
The tone registers
at
memory locations 36874, 36875, and 36876 pro-
duce continuous frequencies ranging from
about
31
Hz (cycles per second)
to 15,980 Hz. A cycle, in tonal frequencies, refers to a sound
that
starts at its
minimum volume, rises to its maximum volume,
and
falls again to its
minimum volume.
j
o
>~~------~----~----~
Minimum volume
The actual tone
of
a sound is a direct function
of
its frequency (how
quickly it rises and falls).
If
you double the frequency, you will have a tone
exactly one octave higher
than
before. Try this program.
10
POKE
36878,15
20
GET
A$:
IF
A$
• '"'
THEN
20
30
IF
Af
•
CHRf(133)
THEN
70
40
IF
A$
•
CHR$(134)
THEN
88
50
IF
A$
•
CHRf(135)
THEN
90
60
IF
AS
•
CHR$(136)
THEN
100
65
GOTO
20
70
POKE
36876,0:
POKE
36875,0:
POKE
36874,240:
ooro
28
80
POKE
36876,0:
POKE
36874,0:
POKE
36875,240:
ooro
20
99
POKE
36875,O:
POKE
36874,0:
POKE
36876,248:
OOTO
20
100
IF
PEEK(36878)
a 9
THEN
10
110
POKE
36878,O:
GOTO
29
Line
10
turns
on
the volume control register so you will be able to hear
the sounds produced by the tone registers. Line
20
waits for a keystroke.
If
the
FI
key
is
pressed, 0
is
POKEd
into the middle
and
high tone registers and
208
is
POKEd
into the low tone register. Pressing the
F3
key POKEs 0 into
the high
and
low tone registers and
208
into the middle tone register.