AY Crudentials: The Envelope Generator

Probably the most technical forum around. It does not have to be coding related, or assembly code only. Just talk about how you can use the AY chip to do cool sounding things :)
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

AY Crudentials: The Envelope Generator

Post by Twilighte »

The AY-8912 Sound chip that lurks within the depths of the Oric has a little used Envelope Generator.
An Envelope Generator controls the volume of a selected channel outside of processor intervention.
This means that once initiated, it will continue without any other action by the user/processor.
However their is only one Envelope generator inside the AY-8912 which therefore detracts the use of it.

The Envelope Generator occupies 3 registers inside the AY-8912 and 3 bits control which channel to take over volume control.
Therefore without alot of processor intervention, it is not possible to change the volume whilst the envelope generator is attached to a channel.

2 of the 3 registers is the period counter.

Note: This may be modified during the production of a volume sequence
The Period counter sets the delay between volume changes.

The last register is the Cycle register and controls what action to perform on the volume.
Whilst the Cycle register may appear as an 8 bit entity, only 4 bits are actually wired inside the AY-8912.
And since each bit represents a different attribute of the action taken, only a few values are really useful.
0 The volume starts at 15 and falls to 0
1 The volume starts at 0 and rises to 15 then resets to 0.
8 The volume starts at 15 and falls to 0 (Repeating)
10 The volume starts at 15 and falls to 0 then rises to 15 (Repeating)
11 The volume starts at 15 and falls to 0 then resets to 15.
13 The volume starts at 0 and rises to 15 and remains at 15.


One significant thing about the Envelope Generator is it's ability to repeat a volume sequence as in the Cycles 8 and 10.

When the period registers are set to high speed (The lower the period the higher the speed) this produces a waveform that is usable as a channel sound (Tone).
The Envelope generator is then capable of producing a limited number of notes as either a sawtooth or triangle waveform.
When attached to a channel. the channel may also produce its own squarewave note and if similar, can produce various different waveforms and effects for a single note.
If the Channel square wave is set to something wildly different, then distortion effects are possible where the envelope generator produces one pitch and the Channel produces another but both through the same output channel.

Note: every write (or read) to the Cycle register will reset the waveform

The possible notes differ for each waveform, whereby the Triangle waveform ( 10 ) will generate half as many recognisable notes as the Sawtooth ( 8 ) waveform.
As a single sequence of successive notes, the Triangle waveform can produce 15 notes (C-0 to D-1) whereas the Sawtooth can produce 27 (C-0 to D-2).
The odd Higher note is possible too.
Nevertheless both waveforms are able to produce notes within a single octave equivalent to the Normal Channels Octave 0 (ORIC MUSIC).