Retro Sound Chips: PSG, FM, Wavetable, and Sample Playback Architectures
Why classic systems sound different: channels, oscillators, envelopes, filters, sample memory, bus timing, and the limits composers turned into instruments.
“Chiptune” covers several unrelated sound architectures. A programmable sound generator may expose square waves, noise, and simple envelopes. FM chips synthesize complex spectra by modulating operators. Wavetable hardware reads short programmable waveforms. Later consoles mix PCM or ADPCM samples from memory. Each design gives composers different constraints and artifacts.
Those categories overlap. A machine can combine a PSG with FM, give one channel a programmable waveform, or add sample playback through a separate chip. Marketing names are inconsistent, so the useful questions are what state software can program, how voices are clocked and mixed, and which parts of the signal path are digital or analog.
Registers are the instrument interface
Game code writes pitch, volume, envelope, routing, and timer registers. Drivers multiplex musical voices onto limited hardware channels. Fast arpeggios can imply chords; noise becomes percussion; carefully timed volume writes create articulation the chip did not natively provide.
A tracker or music driver converts notes and effects into timed register changes. When a chip offers fewer voices than the composition needs, the driver allocates priorities: a sound effect may steal a music channel, or several notes may time-share one oscillator. This is why the same composition can sound different under heavy gameplay even though its score has not changed.
Register writes are observable events, not a static preset loaded once per song. Portamento, vibrato, tremolo, pitch bends, sampled drums, and speech tricks may update values many times per video frame. An emulator that applies every write only at the end of a frame can blur or entirely miss those techniques.
PSGs: counters, duty cycles, noise, and envelopes
Programmable sound generators such as the Texas Instruments SN76489 family and General Instrument AY-3-8910 family typically use clock dividers to generate tone channels plus a pseudo-random noise source. Software programs periods and attenuation or volume. Some variants include hardware envelope generation or I/O functions; pinouts, divider behavior, noise taps, and volume curves differ across members of a nominal family.
A square wave is defined by more than pitch. Duty cycle changes harmonic content, while a volume table may be logarithmic rather than linear. Noise comes from a linear-feedback shift register whose width, feedback taps, reset state, and clock source determine the sequence. Substituting generic white noise is audible and can break software that depends on a repeatable pattern.
The Nintendo Game Boy illustrates a mixed PSG-style design: pulse channels, a programmable wave channel, and noise, with sweep, length, and envelope units. Hardware revisions have behavioral differences and register edge cases. Describing it simply as “four square-wave channels” loses the architecture composers actually programmed.
FM synthesis: operators and algorithms
Frequency-modulation chips build a voice from operators, usually phase generators feeding sine-derived functions and envelopes. One operator modulates another’s phase to create sidebands and complex spectra. Algorithms choose which operators modulate others and which reach the output; feedback adds another source of harmonic complexity.
Pitch, detune, multiplier, envelope rates, total level, key scaling, panning, and algorithm selection form a large parameter space. The Yamaha YM2612 used in the Mega Drive/Genesis provides six FM channels based on four operators per channel, with one channel able to play 8-bit PCM through its DAC path. Games combine that facility with the separate PSG inherited through the console’s compatibility design.
FM emulation must reproduce phase and envelope timing, operator routing, timer behavior, key-on events, register-write timing, and output conversion closely enough for software. A generic mathematical FM synthesizer may produce a similar instrument while missing the exact chip’s tables, truncation, overflow, and DAC characteristics. The open ymfm implementation documents its goal of emulating multiple Yamaha FM families from their common structures and chip-specific behaviors.
Wavetable and programmable-wave channels
“Wavetable” can describe different systems. In a simple programmable-wave channel, software fills a short waveform RAM and hardware repeatedly reads it at a programmable phase increment. Changing the table produces a new timbre; changing entries during playback can create additional effects or hardware quirks.
More elaborate wavetable synthesizers select longer stored waves, interpolate samples, loop regions, apply envelopes and filters, and mix many voices. They are closer to sample-based synthesizers than to a single Game Boy wave channel. Preservation notes should state the actual chip and mechanism rather than treating every stored waveform as the same architecture.
Aliasing is part of the historical output. A short stepped waveform repeated at high pitch contains harmonics above the output Nyquist rate. The original divider, DAC, and analog filter shaped those components. An emulator can render at a high internal rate and resample cleanly, but an overly aggressive “improvement” may remove characteristic artifacts.
PCM and ADPCM sample playback
PCM hardware reads numeric samples that directly represent amplitude. Channels add address generation, playback rate, loop points, volume, and panning; some systems include interpolation, filters, envelopes, or effects. Sample memory and bandwidth constrain duration and fidelity, so composers reuse short loops and trade sample rate against storage.
ADPCM stores differences or predictions more compactly than straightforward PCM. A decoder reconstructs approximate samples using predictor state and step-size rules. Formats with the same ADPCM label are not necessarily compatible. Correct emulation preserves nibble order, predictor saturation, loop state, end conditions, and timing of DMA or memory fetches.
The Amiga’s Paula audio channels are a useful sample-playback example: DMA reads sample data from memory and hardware plays it using programmable periods, lengths, and volume. Its sound emerges from those digital transfers plus conversion and the analog output path, not from one abstract “16-bit audio file player.”
The analog path matters
The digital register model is only part of the sound. Clock rate, resampling, filters, DAC behavior, mixing levels, and analog output stages affect the captured waveform. Two hardware revisions may therefore sound measurably different even when software writes identical values.
Nonlinear mixing is important on some systems. Adding channels as ideal floating-point signals can differ from the resistor network, DAC ladder, saturation, or shared output circuitry on hardware. Console revisions and regional clocks can shift pitch, noise, or filter response. External expansion audio may enter through cartridge or console mixing paths with its own level.
Hardware captures must document console revision, modifications, cable, loading, recording interface, gain, sample rate, and post-processing. A compressed online clip cannot establish exact chip behavior. Direct digital reconstruction and analog capture answer related but different preservation questions.
Emulation tradeoffs
An emulator can use efficient high-level synthesis or reproduce internal counters and nonlinear behavior more closely. Incorrect clock conversion causes pitch drift; poor resampling aliases high frequencies; ignoring write timing smears effects. Validation uses hardware captures, diagnostic programs, and documented schematics where available.
Event-driven synthesis can jump between register changes and counter transitions without evaluating every master clock, provided it produces the same observable sequence. Band-limited synthesis can reduce unintended host-rate aliasing while retaining modeled hardware behavior. “More oversampling” is not a substitute for correct timers, tables, and write ordering.
Audio and video clocks rarely divide into the host sound-card rate perfectly. The emulator generates according to the source clock and resamples to the output device while keeping buffers stable. If it derives pitch from a rounded frame rate, long sessions can drift or periodically correct. Save states must retain oscillator phases, envelopes, noise state, sample addresses, filters, timers, and fractional resampler state where required for seamless restoration.
How to test a sound core
Diagnostic programs isolate one channel and sweep periods, volume codes, envelopes, algorithms, timer boundaries, and register-write phases. Compare digital traces or carefully controlled hardware captures, align them in time, and examine both waveform and spectrum. Then test real music drivers that stress rapid writes and channel interaction.
Regression fixtures should include hashes of test programs, expected register logs, hardware revision, clock, and capture method. Listening tests catch perceptual failures but are not enough by themselves; two errors can sound pleasing and still cancel in one song. Conversely, a mathematically different waveform may be below audibility, so engineering decisions should state whether the goal is electrical, software-visible, or perceptual accuracy.
Preserve source modules, driver code, instruments, sample banks, register logs, and documented playback tools when available. A stereo recording preserves one rendering. The executable data and device model preserve interactive changes driven by gameplay, tempo, random state, and sound effects.
Preservation should keep original program/audio data and record hardware revision and capture chain. A streamed soundtrack preserves one performance; emulation preserves the interactive instrument that creates it.
Related:
- Fixing Audio Crackling and Stuttering in Emulators
- Cycle-Accurate Emulation and Why It’s So Hard to Get Right
Sources: