# Sound: the 3-voice wavetable generator (WSG) ## What it is Three voices, each a frequency added into an accumulator 96,000 times a second; the top five bits of the accumulator step through a 32-sample waveform of 4-bit samples, chosen from eight waveforms in a 256 x 4 sound PROM (`1m`); the sample is scaled by a 4-bit volume and the voices are summed into one amplifier (LOM, which credits Frederic Vecoven's sound investigation). | Register | Address (low nibble only) | Notes (LOM table 7) | | --- | --- | --- | | voice 1 accumulator | 5040-5044 | 20 bits; the hardware's | | voice 1 waveform | 5045 | 3 bits | | voice 2 accumulator | 5046-5049 | 16 bits (no lowest nibble) | | voice 2 waveform | 504A | | | voice 3 accumulator | 504B-504E | 16 bits | | voice 3 waveform | 504F | | | voice 1 frequency | 5050-5054 | 20 bits | | voice 1 volume | 5055 | | | voice 2 frequency | 5056-5059 | 16 bits | | voice 2 volume | 505A | | | voice 3 frequency | 505B-505E | 16 bits | | voice 3 volume | 505F | | Sound enable: 5001 bit 0 in LOM's table, 50C0 in LOM's prose (C2); the 74LS259's wiring on the schematic decides. ## It is TTL, not a chip In Pac-Man the WSG is not a custom chip. Midway's parts glossary (PMM p. 35; DOC) lists the pieces such a generator is built from: **74S89** 16 x 4 RAMs (the register file: 32 nibbles), **74LS283** 4-bit adders (the accumulator arithmetic, a nibble at a time), 256 x 4 **PROMs** (the waveforms, and the `3m` PROM, which LOM calls a second sound PROM and is more likely the sequencing PROM that steps the adder through the voices: U7), **CD4066** analog switches (volume), and the **LM377** amplifier. The WSG therefore works serially: one nibble of one voice per clock, which is why voices 2 and 3 lack the low nibble and why 96 kHz is the CPU clock / 32. The board builder traces this from the schematic sheets in PMM (U8) and writes the WSG as that sequence, so the register file's contents (which the CPU writes but the hardware also updates: the accumulators) are exactly what the circuit holds at each clock. ## MAME (closed box) Device `namco` "Namco @ 96.00 kHz" (`-listdevices pacman`); source file `devices/sound/namco.cpp`/`.h`, `license:BSD-3-Clause` (Nicola Salmoria, Aaron Giles; read 2026-11-26). Its audio output is the detector for M4. ## A shared WSG core with Namco System 1? (open decision 3) The brief asked whether namcos1-python (Phase 0 tonight, now finished: its `docs/sound.md`) and this board should share a wavetable core. | Chip | Machines | Voices | Waves | Built as | | --- | --- | --- | --- | --- | | Pac-Man WSG (MAME `namco_wsg`) | Pac-Man and its 152 Namco-sound siblings here; Galaga, Dig Dug, Bosconian, ... (MAME) | 3, mono | 8 x 32 in a PROM | TTL and PROMs (PMM) | | Namco 15XX (MAME `namco_15xx`) | Mappy, Gaplus, Toy Pop (MAME) | 8 | PROM | custom chip | | CUS30 (MAME `namco_cus30`) | Namco System 1, System 86, Pac-Land, ... | 8, stereo, noise | in RAM, written by software | custom chip | namcos1-python's conclusion, which this Phase 0 shares: the three "share an idea, not a register map". Pac-Man's WSG and System 1's CUS30 differ in voice count, wave storage, register layout, stereo and noise; a shared core would be three variants behind one name. **Recommendation: no shared core now.** The WSG stays in this board behind a pin-shaped class (`Wsg`: write(offset, nibble), clock(), output()). Its first second consumer in the x-python shape would be a Galaga, Dig Dug or Bosconian board; when one starts, extract `namco-wsg-python` with history. emu-galaga's Rust WSG (a site project outside the x-python shape, written from MAME's BSD-3 `namco.cpp`) is a useful detector, not a source to copy.