Chris Collins

Tools · retro

POKEY sound designer

Design Atari 400/800/XL/XE POKEY sounds — four channels of AUDF/AUDC with every distortion mode and volume-only output, AUDCTL 16-bit linking, 1.79 MHz clocking, high-pass filters and 9-bit poly — hear them through a POKEY model, and export Atari BASIC SOUND, POKEs, assembler or PAL/NTSC note tables.

Added

How to use it

Press Sound on, tick Sounding on a channel, or play the piano or your keyboard (A W S E D F T G Y H U J K, Z/X for octave) on the chosen channel.

For each channel:

  • AUDF — the divider: bigger is lower. Set from note picks the nearest AUDF for the channel’s current clock.

  • Distortion — AUDC bits 7–5 choose how the polynomial counters gate and shape the output: pure tone (10 or 14), the buzzy 4-bit poly (12), white noise from the 17-bit (or 9-bit) poly (8), and the 5-bit-gated mixtures (0, 2, 4, 6) that give engines, rumbles and explosions.

  • Volume — 0–15; Volume only (AUDC bit 4) outputs the level directly, which is how samples are played.

AUDCTL changes the whole chip: a 15 kHz instead of 64 kHz base clock; channels 1 and 3 clocked at the full 1.79 MHz; channels 1+2 and/or 3+4 joined into 16-bit dividers (for accurate, wide-range pitch — the sound comes out of channels 2 and 4); high-pass filters (channel 1 by 3, 2 by 4); and the 9-bit poly for more tonal noise.

The register strip shows $D200–$D208. Export writes Atari BASIC — SOUND statements when AUDCTL is 0 (BASIC’s SOUND resets AUDCTL), POKEs otherwise — or an assembler block. The note table gives AUDF for every note in each clock mode, PAL or NTSC, with the tuning error.

Formulae

  • Output frequency = Fin ÷ (2 × (AUDF + M)).

  • Fin is the base clock (CPU clock ÷ 28 ≈ 64 kHz, or ÷ 114 ≈ 15 kHz) with M = 1, or the CPU clock (1 789 790 Hz NTSC, 1 773 447 Hz PAL) with M = 4 (8-bit) or M = 7 (16-bit).

  • SOUND 0,121,10,8 plays middle C on an NTSC machine.

Limits

The model clocks the 4-, 5-, 9- and 17-bit polynomial counters at the CPU rate and samples them at each divider pulse, as POKEY does, so distortions have the right character. The analogue output stage (POKEY mixes channels non-linearly) and two-tone/serial modes are not modelled.

Sharing

Share link copies a link that carries the whole patch — four channels (AUDF, distortion, volume), AUDCTL, 16-bit pairs, clock, and export format — packed in ?s=. Opening it sets up the same sound; press Sound on to hear it.

Runs entirely in your browser; nothing you type leaves this page.