location
"audiodata"
and you are using channel
0,
here
is
how
to
set the location regis-
ters:
AUDOLC
EQU
AUDOLCH
;AUDOLC stands for AUDOLCL
WHEREODATA:
LEA AUDIODATA,
AO
MOVE.L
AO,
AUDOLC
;Put address (82 bits)
; into location register.
The
length of the
data
is
the number of samples
in
your waveform divided by
2,
or the
number of words
in
the
data
set. Using the sample
data
set above, the length of the
data
is
16
words. You write this length into the audio
data
length register for this chan-
nel.
The
length register
is
called AUDxLEN, where
"x"
refers
to
the channel number.
You set the length register
AUDOLEN
to
16
as shown below.
SETAUDOLENGTH: MOVE.W
#16,
AUDOLEN
SELECTING
THE
VOLUME
The
volume you set here
is
the overall volume of all the sound coming from the audio
channel.
The
relative loudness of sounds, which
will
concern you when you combine
notes, is determined by the amplitude of the wave form. There is a six-bit volume regis-
ter for each audio channel.
To
control the volume of sound
that
will be
output
through
the selected audio channel, you write the desired value into the register AUDxVOL,
where
"x"
is replaced by the channel number. You can specify values from
64
to
O.
These volume values correspond to decibel levels.
At
the end of this chapter is a table
showing the decibel value for each of the
65
volume levels.
For
a typical
output
at
volume
64,
with maximum
data
values of -128 to
127,
the voltage
output
is
between
+.4
volts and -.4 volts. Some volume levels and the corresponding decibel values are shown
in
table 5-2.
Audio Hardware
139