Sound And Music - Commodore VIC-20 Programmer's Reference Manual

Hide thumbs Also See for VIC-20:
Table of Contents

Advertisement

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 jf 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 musio-it is otten 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-MUSIG-LOWEST)
36875 (SPEAKER 2-MUSIG-MIDDLE)
36876
(SPEAKER 3-MUSIG-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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents