Many people fondly remember the original Nintendo Entertainment System and the games that graced the platform. Many also remember the music used in these titles, enough to want to listen to it today. There are bands who play these tunes and people who render them in MIDI. But for the purists, the video game fundamentalists, this will not do. They want to listen to the music as it sounded coming out of that magic grey box, oh so long ago, damnit. And that's where the Nintendo Sound Format comes in.

The Nintendo Sound Format is a file format for holding and distributing the chunks of code responsible for generating the music from Nintendo games. Rather than holding actual audio data, it contains the instructions that generate the music. Because of this, they require a special player to listen to. The player must be able to understand the file format and emulate a Nintendo. The most common players are currently plugins for winamp, however there are some stand alone players. The format itself is relatively new. Version 1.0 of the specification was release on May 11th, 1999 and has been revised and improved several times since then.

The format itself is based loosely on the PSID format for distributing sound for the C64. The rest of this writeup refers to version 1.61 of the specification released on June 27th, 2000(1).

offset  # of bytes   Function
----------------------------

0000    5   STRING  "NESM",01Ah  ; denotes an NES sound format file
0005    1   BYTE    Version number (currently 01h)
0006    1   BYTE    Total songs   (1=1 song, 2=2 songs, etc)
0007    1   BYTE    Starting song (1= 1st song, 2=2nd song, etc)
0008    2   WORD    (lo/hi) load address of data (8000-FFFF)
000a    2   WORD    (lo/hi) init address of data (8000-FFFF)
000c    2   WORD    (lo/hi) play address of data (8000-FFFF)
000e    32  STRING  The name of the song, null terminated
002e    32  STRING  The artist, if known, null terminated
004e    32  STRING  The Copyright holder, null terminated
006e    2   WORD    (lo/hi) speed, in 1/1000000th sec ticks, NTSC
0070    8   BYTE    Bankswitch Init Values 
0078    2   WORD    (lo/hi) speed, in 1/1000000th sec ticks, PAL
007a    1   BYTE    PAL/NTSC bits:
                 bit 0: if clear, this is an NTSC tune
                 bit 0: if set, this is a PAL tune
                 bit 1: if set, this is a dual PAL/NTSC tune
                 bits 2-7: not used. they *must* be 0
007b    1   BYTE    Extra Sound Chip Support
                 bit 0: if set, this song uses VRCVI
                 bit 1: if set, this song uses VRCVII
                 bit 2: if set, this song uses FDS Sound
                 bit 3: if set, this song uses MMC5 audio
                 bit 4: if set, this song uses Namco 106
                 bit 5: if set, this song uses Sunsoft FME-07
                 bits 6,7: future expansion: they *must* be 0
007c    4   ----    4 extra bytes for expansion (must be 00h)
0080    nnn ----    The music program/data follows

As you can see, it is basically a header wrapped around the original binary data. The header contain 3 basic types of information.

First, there is identifying information. The first 5 bytes identify the file as an NSF file. The name, artist and copyright holder fields identify the origins of the data contained. The version number tells the player whether it should be able to understand the format or not.

Second is information on where to deal with the data. The load address and bank switching fields tell the emulator where to put the data. The init address tells the emulator where to call to set up the song. The play address tells the emulator where it should call to play the actual song. The total songs field tells the emulator how many songs are in the data and the starting song tells it which one it should start on.

Third is information on how to process the data. The PAL/NTSC field and the Extra Sound Chip field tell the emulator how it should behave. The speed fields tell the emulator how frequently to call the play address.

Put these together and you have enough information to load the file, know what it is and play it. That's the Nintendo Sound Format in a nutshell.

(1) http://www.tripoint.org/kevtris/nes/nsfspec.txt - NSF Spec

Log in or register to write something here or to contact authors.