SOUND
sUbprogram
CALL
SOUND(duration, frequencyJ. volumeJI ,frequency2,
volume211.
frequency3,
volume311
Jrequency4, volume4l)
Thc
SOUND
::'UUVI
UI;I
dill
lells
thc
LUllIvulcl
lu
lJIUUULC
lUllCb
uf
different frequencies.
The
values you include control
three
aspects
of the tone:
• duration - how long the tone lasts.
• frequency -
what
tone actually plays.
• volume - how loud the tone is.
The
duration, frequency,
and
volume
are
numeric expressions. If the
evaluation
of
any
of
the
numeric
expressions
r('
..
~'lUlts
in
a
non
intq~cr
value. the result is
rounded
to obtain an integer.
The
valid ranges
for
each of these
are
given in the table
and
discussed further below.
Value
Range
duration 1 to 4250. inclusive
-1
to
.-4250,
inclusive
frequency (Tone) 110
to
44733. inclusive
(Noise)
-1
to
-8,
inclusive
volume
0 (loudest)
to
30
(quietest), inclusive
Duration
The
duration you specify is
measured
in milliseconds.
One
second is
equal to 1000 milliseconds.
Thus,
the
duration
ranges
from .001 to
4.25 seconds.
(The
actual
duration
may vary
as
much
as
1/60th
of
a second.)
The
duration you specify applies to each sound
generated
by a
particular
CALL
SOUND
statement.
In a program,
the
computer
continues performing
program
statements
while a
sound
is being played. When you call the
SOUND
subprogram,
the
computer
will
wait
until the previous
sound
has
been
completed before performing the new
CALL
SOUND
statement
unless a negative duration is specified.
If
you
specify a negative duration in the new
CALL
SOUND
statement.
the previous sound is
stopped
and
the
new
one
is begun
immediately.
II·84
Examples:
>CALL
SOUND(100,294,2)
>NEW
>100 TONE=110
>110
FOR
COUNT=1
TO
10
>120
CALL
sDUND(-500,TONE,1)
>130 TONE=TONE+110
>140
NEXT
COUNT
>150
END
>RUN
plays
ten
tones
quickLy
DONE
**
>120
CALL
SOUND(+500,TONE,1)
>RUN
--plays
ten
tones
slowLy
**
DONE
**
User's Reference Guide