EasyManua.ls Logo

Atari XL

Atari XL
262 pages
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...
Sound
and
Music
89
P
and
CHAN
in
line
12060,
then
calling
the
routine
normally
called
when
the
OPTION
key
is pressed.
When
running,
the
program
constantly
cycles
through
the
two
routines
FUNKEY
and
KEYBOARD
which
read
the
two
keyboards,
until
a
keypress
is
detected.
The
appropriate
subroutine
is
called
and
SOUND
parameters
for
the
selected
channel
changed
by
ei
ther
the
DECREASE
or
INCREASE
subroutines.
After
each
keypress
is
processed,
the
PLAY
routine
at
8000
is
called
to
update
the
noise,
and
the
program
awaits
the
next
keypress.
PLAYING TUNES
To
play
tunes,
we
must
(feed' a
SOUND
command
with
a
series
of
frequency
parameters
in
turn,
and
one
way
of
doing
this
is
shown
in
this
example:
10
SOUND
0,INT(100*RND(I»,10,8:
GOTO
10
As
mentioned
earlier,
all
four
channels
are
independant
-
allowing
us
to
play
four
different
tones
at
once
on
each
channel.
5
REM
CACOPHONY!
10
SOUND
0,INT(10*RND(1»,10,8
20
SOUND
I,INT(50*RND(1»,10,8
30
SOUND
2,INT(lOO*RND{1»,10,8
40
SOUND
3,INT{250*RND{l»,10,a
50
GOTO
10
Nei
ther
of
these
examples
could be
described
as
music,
for
that
we
need
a
more
controlled
way
of
calculating
frequencies.
The
table
in
Appendix
10
lists
the
frequency
values
corresponding
to
musical
notes
(if
you
are
unfamiliar
with
musical
notation,
refer
to
Appendix
12).
Using
this
table
we
can
build

Related product manuals