APU pulse channel pitch sounds low

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
JSBryan
Posts: 3
Joined: Sat Oct 08, 2016 4:13 pm

APU pulse channel pitch sounds low

Post by JSBryan »

I am working on APU pulse channels. My music pitch sounds low. I didn't do down sampling or apply any enhancements. Is this normal or something is wrong with my period used in pulse waveform generator? If I use every other 40th samples, pitch sounds about right but it also sounds like there are gaps in between tones. Currently sweep and 11-bit timer can alter my period. Is there anything I am missing?
User avatar
Disch
Posts: 1848
Joined: Wed Nov 10, 2004 6:47 pm

Re: APU pulse channel pitch sounds low

Post by Disch »

You **MUST** do some form of down sampling. The NES outputs ~1790 KHz but you'll usually only want to output ~48 Khz (or 44KHz).

Outputting 1 sample every ~40 clocks is one form of downsampling (commonly referred to as "nearest neighbor"). It will work but will be very low quality. If the pitch sounds about right when doing that, then your pulse is probably fine -- you just need to properly downsample it.
User avatar
Quietust
Posts: 1920
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: APU pulse channel pitch sounds low

Post by Quietust »

If you're downsampling to 44100Hz, your divider needs to be exactly 3125/77 for NTSC (1789772.72727... / 44100, around 40.5844) rather than an even 40, otherwise your pitches will be off.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
Post Reply