Ricoh 2A03 (NTSC) · Ricoh 2A07 (PAL) · on-chip APU

2A03 Sound Lab

The NES and Famicom sound chip, emulated register by register: two pulses, a triangle, noise and delta-modulated samples. Switch the region and every clock, table and tempo follows.

All sound labsGame Boy · NES · Master System · Mega Drive · C64 · SNES
Region
Browsers keep audio off until you click. Effects and keys start it too.
Jump to the tracker

Output

The non-linear mix after the console's two high-pass filters and its low-pass filter.

Engine idle
Mixer and analog warmth

Keyboard

Keys Z S X D C V… and Q 2 W 3 E R… play two octaves. Each channel plays one note at a time.

Register map

$4000–$4017. Click a bit to flip it or type a hex byte. The APU registers are write-only, except $4015, which reads back channel status.

AddrNameBits 7…0WriteCPU readsFields
Write log · newest first

    How the chip makes sound

    click to open

    Timers count CPU cycles

    The APU sits inside the CPU and runs from its clock: 1.789773 MHz on the NTSC 2A03 and 1.662607 MHz on the PAL 2A07. Each channel's timer counts down and steps its waveform when it reaches zero.

    • Pulse: CPU / (16 × (t + 1)) Hz, 8-step duty sequence. A timer below 8 mutes the channel.
    • Triangle: CPU / (32 × (t + 1)) Hz, 32-step ramp, no volume control.
    • Noise: a 15-bit shift register clocked from a 16-entry period table; mode 1 taps bit 6 for a 93-step metallic loop.
    • DMC: plays 1-bit delta samples from $C000–$FFFF at 16 rates; $4011 sets the 7-bit level directly.

    The frame counter

    Envelopes and the triangle's linear counter tick on quarter frames; length counters and sweeps on half frames.

    Region differences

    2A03 · NTSC2A07 · PAL
    CPU clock1.789773 MHz1.662607 MHz
    Video frames60.10 Hz50.01 Hz
    Frame counter (4-step)29830 cycles33254 cycles
    Noise periods4 … 40684 … 3778
    DMC rates428 … 54398 … 50

    Games that advance their music once per video frame play about 17% slower on PAL. The tracker follows FamiTracker instead: tempo is in beats per minute, so a song keeps its speed while the frame grid changes, and pitches come from the selected clock.

    Mixing

    The channels are mixed non-linearly by resistor networks: 95.88 / (8128 / (p1 + p2) + 100) for the pulses and 159.79 / (1 / (t/8227 + n/12241 + d/22638) + 100) for the rest. That is why a loud DMC sample makes the triangle and noise quieter.

    Not emulated: frame and DMC interrupts, DMA cycle stealing, and cartridge expansion audio.