It is currently Tue Jan 16, 2018 4:36 am




Post new topic Reply to topic  [ 4 posts ] 
 Breaking the NES 75/150 BPM Code 
Author Message
God
User avatar

Joined: Thu Apr 20, 2006 1:18 am
Posts: 640
Location: Taint Paul, MN, USA
Post Breaking the NES 75/150 BPM Code
While Xiv and I were working on 2A03, I quickly noticed that all of the NES games I was ripping audio from were either 75 BPM or 150 BPM (which makes sense, since they are technically the same speed). I thought this to be a weird coincidence, and figured it was a limitation of the processor and somehow tied to the clock speed of Nintendo's processor (which possessed a clock speed of 1.79 MHz).

I've been looking for a while on the net, looking for anyone to corroborate my findings, and have unfortunately come up short.

Short of chalking up this coincidence to some sort of mysterious clock speed voodoo (which would undoubtedly require math skills beyond what I've done in the past 10 years), I was about to give up on figuring out the answer.

Yesterday, Xiv and I began discussing starting up an NES side-project, one that would produce 100% original NES tunes, using only samples from the original NES, or waveform generators modeled after the original NES sound algorhythms. With this discussion, my interest in finding the answer to this was re-invigorated, and while at work today, I began another series of Google searches, none of which gave me an answer.

However, I did get a clue as to how the sound is generated. I found a page which discussed why some .NSF files sound different than the original NES cartridge. the article explained that the sound was based off the frame rate of the video, and that in North America and Japan (NTSC), the frame rate is 29.97 frames per second (FPS), and in Europe (PAL), it's 25 fps.

Armed with this, I started doing some math. If a beat on a NTSC NES lasted one video frame, the beat would be .0333 seconds long, which would give a BPM of 1798.2 BPM. I plugged in the data for a beat lasting 2 frames, 3 frames and so on up to 29 frames. (FPB = Frames per Beat)

Code:
FPB  BPM-NTSC
1    1798.2
2    899.1
3    599.4
4    449.55
5    359.64
6    299.7
7    256.89
8    224.78
9    199.8
10   179.82
11   163.47
12   149.85
13   138.32
14   128.44
15   119.88
16   112.39
17   105.78
18   99.9
19   94.64
20   89.91
21   85.63
22   81.74
23   78.18
24   74.93
25   71.93
26   69.16
27   66.6
28   64.22
29   62.01

Obviously this isn't what I was looking for, and shows that the BPM could be something other than 75 or 150 (actual BPM as per the above list is 74.93 and 149.85).

So the question is, if they could choose all of these speeds, why is everything 75/150)?

For shits and giggles, I took the same formula that I came up with for BPM based off NTSC, and used PAL's 25 fps instead of the 29.97. Here's the results:

Code:
BPF  BPM-PAL
1    1500
2    750
3    500
4    375
5    300
6    250
7    214.29
8    187.5
9    166.67
10   150
11   136.36
12   125
13   115.38
14   107.14
15   100
16   93.75
17   88.24
18   83.33
19   78.95
20   75
21   71.43
22   68.18
23   65.22
24   62.5
25   60

And then it became crystal clear. Notice on NTSC, 74.925 and 149.85, and on PAL we have the magic numbers of 75 & 150. Look at all of the other numbers, and none of them are really close (Aside from 300 which is just a factor of 75/150, and 100, which is a triplet of 150). It seems that 75 & 100 were chosen strictly because porting a game from NTSC to PAL would only require that the Frames Per Beat be changed, rather than completely rewriting the musical score.

So I'm assuming that it's possible to find some games that are not at 75/150 BPM, but I'm guessing that they would mainly be older games (since the NES was huge in Japan and America long before taking root in Europe) and with games designed only for Japanese release (if it's not getting ported, why be restricted to 75/150?).

All this really proves is that I'm a huge dork. :)

AGNP

_________________
My last.fm top artists for the past week:
Image


Mon Nov 13, 2006 5:54 pm
Profile
Audio Nullificator
User avatar

Joined: Sun Apr 23, 2006 5:00 am
Posts: 145
Location: Hell Frozen Over
Post 
This is what you get paid to do?

_________________
Life is a disease, sexually transmitted and fatal.
My last.fm top artists for the past week:
Image


Mon Nov 13, 2006 6:00 pm
Profile
God
User avatar

Joined: Thu Apr 20, 2006 1:18 am
Posts: 640
Location: Taint Paul, MN, USA
Post 
Define "get paid"...

and define "do"......

AGNP

_________________
My last.fm top artists for the past week:
Image


Mon Nov 13, 2006 7:34 pm
Profile
Pickle Tickler
User avatar

Joined: Tue Aug 08, 2006 12:30 pm
Posts: 317
Post 
Okay... I am impressed.
Your single minded search has provided me with yet another bit of utterly usless esoteric trivia to bore and bewilder the gentler sex with at parties and other related social gatherings.
HUZAH!

_________________
Sample, shred, manipulate.


Tue Nov 14, 2006 11:27 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.