EasyManua.ls Logo

Commodore 128D - Page 145

Commodore 128D
427 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
+1
in
line
30
tells
the
computer
to
generate
a
random
number
in
the
range
between
1
and
3.
The
procedure
for
generating
a
random
number
in
a
specific
range
is
to
multiply
the
given
random
number
times
the
maximum
value
of
the
parameter
(in
this
case,
3).
If
the
minimum
value
of
the
parameter
is
greater
than
zero,
add
to
the
ran
dom
number
a
value
that
will
specify
the
minimum
value
of
the
range
of
numbers
you
want
to
generate
(in
this
case,
1).
For
instance,
line
40
generates
a
random
number
in
the
range
between
0
and
65535.
Since
the
minimum
value
is
zero
in
this
case,
you
do
not
need
to
add
a
value
to
the
generated
random
number.
Line
110
PRINTs
the
values
of
the
parameters.
Line
120
plays
the
SOUND
specified
by
the
random
numbers
generated
in
lines
30
through
100.
Line
130
delays
the
program
for
4
seconds
while
the
sound
is
playing.
Line
140
turns
off
the
SOUND
after
the
4
second
delay.
All
sounds
generated
by
this
program
play
for
the
same
amount
of
time,
since
they
are
all
turned
off
after
4
seconds
with
line
140.
Finally,
line
150
returns
control
to
line
10,
and
the
process
is
repeated
until
you
press
the
RUN/STOP
and
RESTORE
keys
at
the
same
time.
So
far
you
have
experimented
with
sample
programs
using
only
the
SOUND
statement.
Although
you
can
use
the
SOUND
statement
to
play
musical
scores,
it
is
best
suited
for
quick
and
easy
sound
effects
like
the
ones
in
the
dogfight
program.
The
CommodSre
128
has
other
statements
designed
specifically
for
song
playing.
The
following
paragraphs
describe
the
advanced
sound
and
music
state
ments
that
enable
you
to
play
complex
musical
scores
and
arrange
ments
with
your
Commodore
128
synthesizer.
137
USING
C128
MODE—Sound
and
Music
in
C.128
Mode

Table of Contents

Other manuals for Commodore 128D

Related product manuals