EasyManua.ls Logo

Atari ST series - Page 85

Atari ST series
420 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...
XBIOS Graphics and Sound Functions
To derive the period values for the next higher octave,
divide the period values in this table in half. For the next
lower octave, multiply each period value in the table by 2.
The final step in sounding a constant tone is to set the
volume level in register 8, 9, or 10, depending on which
channel you're using. The low four bits of this register are
used to set the volume from 0 (silent) to 15 (maximum vol
ume). Bit 4 should be set to 0 if you're trying to create a
sound that has a constant value. Once you have enabled a
tone channel, set the pitch and selected a volume, the sound
will continue to play until you disable the channel or set the
volume to 0.
It's also possible to create tones that use various wave
form envelopes instead of a constant volume. These tones
vary in volume level according to the waveform chosen. A
single waveform may be selected for all three voice channels
by setting register 13. A chart of the available waveforms is
shown in Figure 4-3.
When using the waveform envelopes, the rate at which
the volume level changes is determined by the waveform pe
riod, which is a 16-bit value placed in registers 11 and 12.
The higher the period, the more slowly the volume level
changes, and the lower the period value, the more quickly it
changes. At high period values, the tones created are bell
like, while at low period values, they are very raspy. To cre
ate a tone using one of the waveform envelopes, set the fre
quency and enable the tone channel as with a constant tone.
Then, set the waveform and waveform period in registers
11-13. Finally, set bit 4 of the proper volume register to one.
Note that tones whose waveforms end in a low, flat line only
sound once, while those that stay up or fluctuate up and
down sound continuously until stopped.
The third type of sound that can be created by the PSG
uses the noise generator. Noise channels vary in frequency,
at a rate determined by register 6, the noise period setting.
This is a 5-bit setting that varies from a thin, static-like sound
(low settings) to a sound like the rushing wind (high set
tings). Noise may be enabled by setting the noise enable bits
of register 7. Like tones, noise may have a constant volume
or a volume that varies according to a waveform envelope.
Noise whose volume is varied according to a waveform with
a large period sounds percussive, like gunshots, drums, or
77

Related product manuals