EasyManua.ls Logo

Commodore VIC-20 - I • Sound and Music

Commodore VIC-20
308 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...
SOUND
AND
MUSIC
Sound
effects
and
music
can
improve
almost
any
computer
program,
whether
in
BASIC
or
Machine
Language.
Obviously,
a
computer
game
is
more
exciting
if
you can
hear
the
guns
blazing
and
the
rockets
exploding.
Likewise,
a
clever
little
tune
provides
an
audio
"theme"
for
a
game
or
other
program,
or
might
become
the
"reward"
if
the
player
reaches
a
special
"high"
score.
Beyond
games,
sound
effects
serve
other
useful
purposes.
For
example,
a business
or
calculation
program
may
be
faster
and
easier
to
use
if
the
computerist
can
enter
a
long
string
of
numbers
or
formulas
without
looking
up
from
a
chart
or
balance
sheet.
A
quick
tone
at
the
end
of
each
entry
indicates
when
a
number
has
been
entered
...
a
'buzz"
might
sound
if
the
number
entered
has
too
many
decimal
places
...
and
different
tones
might
be used
to
distinguish
one
kind
of
entry
from
another.
These
are
just
a
few
ideas
about
how
sound
and
music
are
used
in
computer
programming.
The
following
information
is
provided
to
help
you
the
programmer
understand
how
to
use
the
VIC's
sound
capability
to
best
advantage.
FOUR
"SPEAKERS"
AND
5
"OCTAVES"
The
VIC
has
3
tone
generators
(for
music},
and
one
white noise
generator
(for
sound
effects).
The
tone
generators cover
3
octaves
each
but
are
staggered
slightly
so
you
can
actually
reach
a
total
of
5
separate
octaves.
The
VIC's
speakers
and volume
control
are stored
in
specific
memory
locations
which
you can
access
and
control
by
using
the
POKE
command.
Whenever
you
poke
one
of
these
locations
you
activate
that
tone
generator,
or
the
volume
control.
When
programming
sound—especially
music—it
is
often
helpful
to
think
of
these
various
sound
controls
as
"speakers,"
and
the
volume
setting
as a
standard
Volume"
control.
Here,
briefly,
is
a
list
of
memory
locations
relating
to
sound:
36878
(VOLUME
SETTING)
36874
(SPEAKER
1—MUSIC—LOWEST)
36875
(SPEAKER
2—MUSIC—MIDDLE)
36876
(SPEAKER
3—MUSIC—HIGHEST)
36877
(SPEAKER
4—NOISE)
There
are
15
volume
settings.
Therefore
to
set the
volume
you
must
type
the
POKE
command,
followed
by a
comma,
and
a
number
95