How long is each NES noise sequence?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
How long is each NES noise sequence?
by on (#178365)
Hi there! :)
I have probably a trivial question: Is this possible to calculate the lenght of single NES noise pseudo-random sequence for each tone? Unfortunately I know nothing about programming, registers, etc. so I can't read this information from specs :(. Everything I need to know is the number of samples (96kHz/16 bit) for each period on the output of emulator. Anyone can help? :idea:
Re: How long is each NES noise sequence?
by on (#178366)
The NTSC NES CPU operates at 315/176 MHz = 1.79 MHz, so you'd take the number of CPU cycles needed to complete the PRNG loop and divide it by 315/176/.096 = 18.643.

Long period noise ($400E bit 7 clear) is 32767 steps long, meaning the entire waveform has a period of 32767 times the period of each step. So you'd look up "The timer period is set to entry P" in the table at APU Noise in the wiki, multiply by 32767, and divide by 18.643.

Short period noise ($400E bit 7 set) is 93 steps long, meaning the entire waveform has a period of 93 times the step period. So you'd look up the period in the table, multiply by 93, and divide by 18.643.
Re: How long is each NES noise sequence?
by on (#178369)
Thank you very much :) :beer: