EasyManua.ls Logo

Commodore Amiga - Joining Tones; Producing Complex Sounds

Commodore Amiga
321 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...
Producing
Complex
Sounds
In addition to simple tones, you can create more complex sounds, such as different musi-
cal notes joined into a one-voice melody, different notes played
at
the same time, or
modulated sounds.
JOINING
TONES
Tones are joined by writing the location and length registers, starting the audio output,
and rewriting the registers
in
preparation for the next audio waveform
that
you wish to
connect to the first one. This is made easy by the timing of the audio interrupts and the
existence of back-up registers. The location and length registers are read by the
DMA
channel before audio
output
begins. The
DMA
channel then stores the values
in
back-
up registers. Once the original registers have been read by the DMA channel, you can
change their values without disturbing the operation you started with the original regis-
ter contents. Thus, you can write the contents of these registers,
start
an audio output,
and then rewrite the registers
in
preparation for the next waveform you want
to
connect
to
this one.
Interrupts occur immediately after the audio
DMA
channel has read the location and
length registers and stored their values
in
the back-up registers. Once the interrupt has
occurred, you can rewrite the registers with the location and length for the next
waveform segment. This combination of back-up registers and interrupt timing lets you
keep one step ahead of the audio DMA channel, allowing your sound
output
to
be con-
tinuous and smooth.
If
you do not rewrite the registers, the current waveform will be repeated. Each time
the length counter reaches zero, both the location and length registers are reloaded with
the same values to continue the audio output.
Example
This example details the system audio
DMA
action
in
a step-by-step fashion.
Suppose you wanted to join together a sine and a triangle waveform, end-to-end, for a
special audio effect, alternating between them.
The
following sequence shows the action
of your program as well as its interaction with the audio DMA system.
The
example
assumes
that
the period, volume, and length of the
data
set remains the same for the
sine wave and the triangle wave.
Audio Hardware 147

Table of Contents

Other manuals for Commodore Amiga

Related product manuals