Long mode noiseWhen the noise channel
Mode flag is clear, the noise channel repeats a sound wave that is 32767 steps long. Each step is pseudo-randomly the minimum or maximum level. Although the sound wave eventually repeats, it's so long in duration that you don't hear it as a definite pitch.
I can clearly hear different tone heights on the noise channel
When you change the
Rate bits, the long-mode noise does sound higher pitched or lower pitched compared to the noise at other rates. But if you try to compare the pitch of the long-mode noise at a specific rate to the pitch of, for example, a square channel tone at a specific pitch, you can't really tell which one is higher or lower in pitch, they're not really comparable.
Short mode noiseWhen the noise channel
Mode flag is set, the noise channel repeats a sound wave that is 93 or 31 steps long. This is short enough to have a perceptible pitch.
For short mode noise, I calculate the pitch as the frequency of the repeating wave. See the attached test.zip under this paragraph. I'm interested in discussing with other people if my calculations are correct. (When I proposed
changes to how FCEUX calculates the pitch of short mode noise, no one replied to my proposal. Now I'm excited someone else is wondering what FCEUX's pitch values mean for the noise channel.)
Attachment:
File comment: Short Mode Noise Pitch Tests for FCEUX
test.zip [2.37 KiB]
Downloaded 313 times
on the noise channel [...] there's a formula in fceux that calculates its midikey for a given frame [...] I also see noise channel is given values in things like famitracker. [...] are these values even notes, or just presences of those frequencies that are internal to the chip?
FCEUXFCEUX assigns lua sound.get().rp2a03.noise.frequency and .midikey values based on the rate.
sound.cpp:
Code:
static const uint32 NoiseFreqTableNTSC[0x10] =
{
4, 8, 16, 32, 64, 96, 128, 160, 202,
254, 380, 508, 762, 1016, 2034, 4068
};
Code:
const uint32 *NoiseFreqTable = NoiseFreqTableNTSC; // for lua only
lua-engine.cpp:
Code:
freq = (39375000.0/44.0) / NoiseFreqTable[freqReg];
Note: I think the (39375000.0/44.0) value represents the NTSC APU clock frequency, but the NoiseFreqTable values are in terms of NTSC CPU clocks.
FamitrackerFamitracker assigns "hex pitch" values in the noise channel: 0-# to 9-# then A-# to F-#. These values are based on the
Rate bits.
Edit: Like tepples says below, Famitracker displays values that are 15 - the PPPP bits, so that the lowest pitch (longest period, PPPP = 1111) is shown as 0 and the highest pitch (shortest period, PPPP = 0000) is shown as F.