NSPC is a file format used by Herringway's nspcplay designed to contain all the data necessary to play music from Nintendo's Kankichi-kun/N-SPC music format.
An NSPC file contains a simple header, followed by a number of variable-length audio packs, followed by optional FIR coefficient tables and APEv2 tags. At minimum, an NSPC file is expected to contain a single sequence, instruments, BRR sample data and a sample directory.
The header is 32 bytes long.
| Offset | Size | Purpose | Description |
|---|---|---|---|
| 0 | 4 | Variant | Identifies the variant of NSPC. See valid identifiers below. |
| 4 | 2 | Sequence address | The SPC700 address that the song's sequence data is loaded to. |
| 6 | 2 | Instrument table | The SPC700 address that the song's instrument table is loaded to. |
| 8 | 2 | Sample directory | The SPC700 address where the BRR samples are expected to be found. |
| 10 | 1 | Release table | The id of the release table to use. |
| 11 | 1 | Volume table | The id of the volume table to use. |
| 12 | 19 | Variant-specific | Variant-specific data. See variant information for details. |
| 31 | 1 | FIR coefficients | Number of FIR coefficients embedded in file. If 0, use defaults. |
An audio pack is a chunk of binary data, prefixed with two 16-bit unsigned integers. Size, followed by length, followed by length bytes of binary data. The last pack MUST have a 16-bit null terminator immediately following it.
This is a chunk of binary data, with a byte length equal to the FIR coefficient table length times eight.
This is the most common variant. The unmodified Kankichi-kun supplied to game developers uses this format.
This is an early version of variant 0, used in early SNES games like Super Mario World.
This is a heavily modified variant 0, with several changed commands. Details are largely unknown.
This is an upgraded version of variant 0, with many new commands. Designed for use in Super Mario World ROM hacks.