Skip to main content
NESdev Wiki
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

APU Noise

The NES APU noise channel generates pseudo-random 1-bit noise at 16 different frequencies.

   Timer --> Shift Register   Length Counter
                   |                |
                   v                v
Envelope -------> Gate ----------> Gate ---> (to mixer)

Registers

Noise envelope settings ($400C, write)

7  bit  0
---- ----
..LC VVVV
  || ||||
  || ++++- When C is set: channel volume value
  ||       When C is clear: envelope divider reload value
  |+------ Constant volume flag (override envelope with V)
  +------- Length counter halt flag and envelope loop flag

Noise mode and period ($400E, write)

7  bit  0
---- ----
M... PPPP
|    ||||
|    ++++- Noise period
+--------- Periodic noise mode

The timer period is set to entry P of the following:

Period (P)NTSCPAL
$044
$188
$21614
$33230
$46460
$59688
$6128118
$7160148
$8202188
$9254236
$A380354
$B508472
$C762708
$D1016944
$E20341890
$F4068 (2046 in early RP2A03 revisions)3778

The period determines how many CPU cycles happen between shift register clocks. These periods are all even numbers because there are 2 CPU cycles in an APU cycle.

Length counter load value ($400F, write)

7  bit  0
---- ----
LLLL L...
|||| |
++++-+---- Length counter load value

Writing to this register also restarts envelope.

Operation

The shift register is 15 bits wide LFSR.

When the timer clocks the shift register, the following actions occur in order:

  1. Feedback is calculated as the exclusive-OR of bit 0 and one other bit: bit 6 if periodic noise mode (M bit) is set, otherwise bit 1.
  2. The shift register is shifted right by one bit.
  3. Bit 14, the leftmost bit, is set to the feedback calculated earlier.

This results in a pseudo-random bit sequence, 32767 steps long when Mode flag is clear, and randomly 93 or 31 steps long otherwise. (The particular 31- or 93-step sequence depends on where in the 32767-step sequence the shift register was when Mode flag was set).

The mixer receives the current envelope volume except when

Within the mixer, the DMC level has a noticeable effect on the noise’s audio level.

On power-up, the shift register is loaded with the value 1.

In the earliest revisions of the 2A03 CPU, the periodic noise flag (M bit) was nonexistent: the shift register always used bits 0 and 1 for feedback, and the lowest period (rate $F) lasts 2046 M2 cycles instead of 4068. These CPUs were used in the first batch of Famicom consoles (which were recalled), in Vs. System boards, and in the arcade games that used the 2A03 as a sound coprocessor. [1], [2]

The 93-step sequence is about a quarter tone (50 cents) sharp relative to A440 tuning. The approximate frequencies and pitches (in LilyPond’s variant of Helmholtz notation) are as follows:

Pitches of 93-step noise
NTSCPAL
Register valueSample rateRepeat rateMIDI notePitchSample rateRepeat rateMIDI notePitch
$80447443.2 Hz4811.2 Hz110.41d''''' + 41¢415651.8 Hz4469.4 Hz109.13c#''''' + 13¢
$81223721.6 Hz2405.6 Hz98.41d'''' + 41¢207825.9 Hz2234.7 Hz97.13c#'''' + 13¢
$82111860.8 Hz1202.8 Hz86.41d''' + 41¢118757.6 Hz1277.0 Hz87.45d#''' + 45¢
$8355930.4 Hz601.4 Hz74.41d'' + 41¢55420.2 Hz595.9 Hz74.25d'' + 25¢
$8427965.2 Hz300.7 Hz62.41d' + 41¢27710.1 Hz298.0 Hz62.25d' + 25¢
$8518643.5 Hz200.5 Hz55.39g + 39¢18893.3 Hz203.2 Hz55.62g + 62¢
$8613982.6 Hz150.4 Hz50.41d + 41¢14089.9 Hz151.5 Hz50.54d + 54¢
$8711186.1 Hz120.3 Hz46.55a#, + 55¢11233.8 Hz120.8 Hz46.62a#, + 62¢
$888860.3 Hz95.3 Hz42.51f#, + 51¢8843.7 Hz95.1 Hz42.48f#, + 48¢
$897046.3 Hz75.8 Hz38.55d, + 55¢7044.9 Hz75.8 Hz38.54d, + 54¢
$8A4709.9 Hz50.6 Hz31.57g,, + 57¢4696.6 Hz50.5 Hz31.52g,, + 52¢
$8B3523.2 Hz37.9 Hz26.55d,, + 55¢3522.5 Hz37.9 Hz26.54d,, + 54¢
$8C2348.8 Hz25.3 Hz19.53g,,, + 53¢2348.3 Hz25.3 Hz19.52g,,, + 52¢
$8D1761.6 Hz18.9 Hz14.55d,,, + 55¢1761.2 Hz18.9 Hz14.54d,,, + 54¢
$8E879.9 Hz9.5 Hz2.53d,,,, + 53¢879.7 Hz9.5 Hz2.52d,,,, + 52¢
$8F440.0 Hz4.7 Hz-9.47d,,,,, + 53¢440.1 Hz4.7 Hz-9.47d,,,,, + 53¢

Edit this page on GitHub