Oric Audio

The Oric makes sound with a General Instrument AY-3-8912, the same chip family used by the 128K Spectrum and many other machines. It has three tone channels, a noise source and a hardware envelope generator. On the Oric the chip is not reached through I/O ports directly; it is driven through the 6522 VIA.

Oric Audio

Overview

All Oric sound comes from the one AY chip. Once its registers are set it plays on its own without the 6502, so music can run under a game. Fourteen registers hold three tone periods, a noise period, a mixer, three volumes and the envelope, and the program reaches them through the 6522 VIA rather than a plain I/O port.

The AY sound chip

The AY-3-8912 has three independent channels, A, B and C. Each has a square-wave tone generator whose pitch is a 12-bit period. The three can be mixed with a single noise generator, and a shared envelope generator can shape volume over time. Each channel's volume is four bits, or a flag that hands the channel to the envelope. Once written, the chip sustains the sound without the CPU.

The 6522 VIA

On the Oric the AY is wired to the 6522 Versatile Interface Adapter, not to the CPU's address space directly. Port A of the VIA carries the data or the register number to the AY's bus, and two control lines, BDIR and BC1, tell the AY whether that value is a register address or data. To write a register the program puts the register number on port A and pulses the control lines to latch it, then puts the value on port A and pulses again to write it.

VIA partRole
Port ACarries the register number or the data byte to the AY
BDIR, BC1Control lines that select latch address or write data
SequenceLatch register number, then write its value

AY registers

Each channel's pitch is a 12-bit period split across two registers, a fine byte and a coarse nibble. Volume is four bits, or a flag that hands the channel to the envelope. The mixer register enables tone and noise per channel with active-low bits.

RegisterContents
0, 1Channel A tone period (12 bits: 8 fine + 4 coarse)
2, 3Channel B tone period
4, 5Channel C tone period
6Noise period (5 bits)
7Mixer: tone and noise enables per channel (active low)
8, 9, 10Channel A, B, C volume (4 bits, or bit 4 = use envelope)
11, 12Envelope period (16 bits)
13Envelope shape

Noise and envelope

The single noise generator has a 5-bit period in register 6 and can be mixed into any channel through the mixer. The mixer, register 7, holds six active-low enable bits: the low three enable tone on channels A, B and C, the next three enable noise on the same channels, so a clear bit lets that source through.

The envelope generator shapes volume over time. Registers 11 and 12 set its 16-bit period, and register 13 picks the shape: attack or decay, whether it holds or repeats, and whether it alternates. A channel follows the envelope when bit 4 of its volume register is set, which lets one setting sweep the volume for fades, plucks and beeps.

Register 7 bitMeaning (0 = on)
0, 1, 2Tone enable for channels A, B, C
3, 4, 5Noise enable for channels A, B, C