Each audio channel includes an eight-bit digital-to-analog converter driven by a direct
memory access (DMA) channel. The audio DMA can retrieve two data samples during each
horizontal video scan line. For simple, steady tones, the DMA can automatically play a
waveform repeatedly; you can also program all kinds of complex sound effects.
There are two methods of basic sound production on the Amiga – automatic (DMA) sound
generation and direct (non-DMA) sound generation. When you use automatic sound
generation, the system retrieves data automatically by direct memory access.
FORMING AND PLAYING A SOUND
This section shows you how to create a simple, steady sound and play it. Many basic
concepts that apply to all sound generation on the Amiga are introduced in this section.
To produce a steady tone, follow these basic steps:
1. Decide which channel to use.
2. Define the waveform and create the sample Table in memory.
3. Set registers telling the system where to find the data and the length of the data.
4. Select the volume at which the tone is to be played.
5. Select the sampling period, or output rate of the data.
6. Select an audio channel and start up the DMA.
DECIDING WHICH CHANNEL TO USE
The Amiga has four audio channels. Channels 0 and 3 are connected to the left-side
stereo output jack. Channels 1 and 2 are connected to the right-side output jack. Select a
channel on the side from which the output is to appear.
CREATING THE WAVEFORM DATA
The waveform used as an example in this section is a simple sine wave, which produces a
pure tone. To conserve memory, you normally define only one full cycle of a waveform in
memory. For a steady, unchanging sound, the values at the waveform’s beginning and
ending points and the trend or slope of the data at the beginning and end should be
closely related. This ensures that a continuous repetition of the waveform sounds like a
continuous stream of sound.
- 134 Audio Hardware -