EasyManua.ls Logo

Commodore VIC-20 - Page 119

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...
c
239
240
240
241
If
two
note
values
are
given,
vary
the
sound
register
on
the
VIC
between
those
two
values,
If
only
one
value
is
given,
don't
vary
the
register
(just
POKE
the
value
in
twice),
i
VIC
TIP:
Here
are
a
few
additional
comments
about
using
DATA
statements
in
your
programs.
In
Example
2
(page
100)
we show
each
note
set
(duration,
note
1,2
and
3)
on
a
separate
line
to
emphasize
that
the
notes
are
arranged
and
played
simultaneously
.
.
.
when
you
enter
this
DATA
in
your
computer,
however,
you
should
not
break
up
the
segments
but
instead
type
all
the
numbers
and
commas
without
any
spaces
between
the
characters.
Typing
programs
without
spaces
is
a
good
way
to
conserve
memory
and
reduces
the
possibility
of
error.
EXAMPLE
4:
THE
VIC
PfANO
Finally,
to
give
you
a
more
familiar
representation
of
how
music
works
on
the
VIC,
here's
a
program
which
converts
the
VIC
keyboard
to
a
"piano."
Abbreviates
the
voice
registers
well
need and
turns
10
REM
STORE
SOUND
REGISTERS
20
S2
=
36675
30
V
-36878
40
POKE
S2,0
100
REM
STORE
B
MAJOR
SCALE
110
FOR N=1
TO
8
120
READ
A
(N)
130
NEXT
N
140
DATA
223,
227,
230
150
DATA
231, 234,
236
160
DATA
238,
239
200
REM
PLAY
KEYBOARD
210
POKE
V,
15
220
GET
AS:
JF
AS=""
THEN
220
230
N-VAL
(AS)
them
off
Reads
B
major
scale
from
lines
140-160
Contains
values
for
B
major
scale
Turns
on
the
volume
Finds
out
what
key
is
being
pressed
103