EasyManua.ls Logo

Commodore Plus 4 - Page 190

Commodore Plus 4
464 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...
178
Some
Programming
Techniques
160
Decrement
the
durations.
170
Wait
briefly.
Change
the
value
here
to
make
all
the
notes
longer
or
shorter.
180
Turn
off
the
volume.
190-350
Data
for
voice
1.
360
End
of
data
for
voice
1.
370-540
Data
for
voice
2.
550
End
of
data
for
voice
2.
Sound
in
Machine
Language
In
machine
language,
sound
is
generated
by
accessing
the
graphics
chip
(which
also
handles
sound)
directly.
The
relevant
registers
are
as
follows:
o
Bit(s)
Function
$FF0E
0-7
Low
byte
of
frequency
for
voice
1
$FF0F
0-7
Low
byte
of
frequency
for
voice
2
$FF10
0-1
High
2
bits
of
frequency
for
voice
2
$FF11
0-3
Volume
4
Select
voice
1
(0
=
off,
1
=
on)
5
Select
voice
2
(0
=
off,
1
=
on)
6
Select
noise
for
voice
2
(0
=
off,
1
=
on)
7
Sound
switch
(0
=
on,
1
=
off)
$FF12
0-1
High
2
bits
of
frequency
for
voice
1
2-7
Nonsound
uses
To
generate
a
sound,
first
select
the
voice
or
voices
to
use
and
the
volume
level
with
register
$FF11.
Normally,
it
is
appropriate
to
set
bit
7
to
1
at
this
time,
to
keep
the
sound
silent
for
the
moment.
Note
that
voice
1
is
on
or
off,
but
voice
2
can
be
on
for
tone,
on
for
noise,
or
off.
If
bit
5
is
set
to
1,
voice
2
generates
tones,
regardless
of
the
setting
of
bit
6.
Next,
set
the
frequencies
in
the
appropriate
registers.
Be
careful
when
setting
the
two
high
bits
of
voice
1
to
leave
the
remaining
bits
of
register
$FF12
unchanged.
To
start
the
sound,
clear
bit
7
of
register
$FF11.
To
stop
the
sound,
set
bit
7
of
register
$FF11
(or
deselect
the
voices
or
set
the
volume
to
zero).
Table
3-4
shows
the
hexadecimal
note
values.
The
following
program
plays
the
first
few
notes
of
Scott
Joplin's
"The
Enter
tainer."
Up
to
255
bytes
of
data
are
stored
at
$2100
in
the
format,
high
byte
of
frequency,
low
byte of
frequency,
duration.

Other manuals for Commodore Plus 4

Related product manuals