NES Architecture: the APU

Let’s talk about sound. The NES’ audio processing unit (or APU for short) to be exact. How does it work and what is it capable of doing?

The NES APU is what generates sounds for NES games. It’s part of the RP2A03 and RP2A07 chip, which also contains the CPU of the console. It has five audio channels: two pulse channels, a triangle channel, a noise channel and a DMC channel.

Pulse1 and Pulse2

The APU has two pulse channels, refered to as Pulse1 and Pulse2. These pulse channels have a square or rectangle waveform, of which you can control the volume, frequency and duty cycle. The volume is a 4-bit value, so there are 16 volume settings available, ranging from $00 (silence) to $0F (full volume). Frequencies use 11 bits, using a division of the CPU Clock speed to generate the desired pitch. This is why music may sound different between PAL and NTSC versions of the console, as the PAL console has a lower clock speed than the NTSC. The duty cycle defines what the waveform looks and sounds like. There are four duty cycles:

  •  12.5% – this gives the channel a sharp, almost sawtooth-like sound.
  •   25% – this sounds a bit less sharp, more round.
  •   50% – this is the square waveform, which sounds the most hollow.
  •   75% – this is an inverse of, and therefore sounds like, the 25% waveform.

Triangle

 The triangle channel has a less harsh tone than the pulse channels. Unlike the pulse channels, the triangle channel has no variable duty cycles (the waveform is always the same) and a 1-bit volume control: it’s either on or off. Because of its limited volume control, the triangle channel is most oftenly used for bass sounds and percussion supports, like kick or tom drum sounds (Mega Man games tend to utilize the latter quite often).

Noise

The noise channel produces, well, noise obviously. This channel is usually used for music percussion, or sound effects like explosions. It has volume control like the pulse channel (4 bits, or 16 possible values). It uses 4 bits for frequenct playback, so there are 16 different noise pitches available. Furthermore, it uses one bit to determine the loop noise: 0 uses a longer random bit generation period (which sounds like whitenoise) and 1 uses a shorter period (which makes it sound more robotic).

DMC

The Delta Modulation Channel (DMC) is the fifth and last channel of the APU. This one works a bit differently than the others: the channel accepts custom waveforms from the cartridge; in other words, it can play samples through its 7-bit PCM signal output. There are two types of samples the DMC channel can play:

  • 1-bit delta pulse code modulation (DPCM) samples; these modify the waveform one bit at a time. This is relatively easy on the CPU, so these samples can be played during gameplay. The downside is that these samples may sound “muffled” because of the lower quality. Super Mario Bros. 3 for example, uses DPCM samples for the percussion drums.
  • 7-bit raw pulse code modulation (PCM) samples; these samples send raw waveform data in 7-bit format, which makes the sample sound quite a lot better than when using DPCM. The downside is that playback of raw PCM samples is very CPU-intensive, which means the CPU can’t do anything else when playing these samples (like updating the screen, handling inputs or any type of other gameplay logic). This means that gameplay is “halted” during playback. This can be seen in Battletoads for example: when punching an enemy, the game freezes while playing the sample.

More channels?

These five channels can be expanded with addition sound chips, which are placed on game cartridges that want to utilize those. The Nintendo MMC5 and Konami VCR6 are two examples of chips that can offer more sounds. The Japanese Famicom console is capable of utilizing these sound expansion chips; the NES however, cannot (unless you’re willing to modify your console by adding a resistor), because this functionality was connected to the expansion port on the bottom. This port originally allowed external hardware -like modems, disk drives or spound expansions – to be connected to the NES, but this has never been utilized commercially.