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 · NTSC | 2A07 · PAL |
| CPU clock | 1.789773 MHz | 1.662607 MHz |
| Video frames | 60.10 Hz | 50.01 Hz |
| Frame counter (4-step) | 29830 cycles | 33254 cycles |
| Noise periods | 4 … 4068 | 4 … 3778 |
| DMC rates | 428 … 54 | 398 … 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.