The audio processing unit: a sound CPU (SPC700), a sound generator (S-DSP) and their own 64 KB of RAM (ARAM), apart from the main CPU. This page is the hardware; music is Music with SNESMOD, samples from C and SPC700 programs of your own are Samples, Voices and the Raw APU, and the converters are opensnes-sample — WAV to BRR samples (WAV to BRR) and opensnes-music — Impulse Tracker to soundbank (Impulse Tracker to soundbank).
| Component | Details |
|---|---|
| SPC700 | 8-bit CPU at 1.024 MHz |
| ARAM | 64 KB, shared by program, data, samples and the echo ring |
| S-DSP | 8 voices playing BRR samples |
| Output | 32 kHz stereo |
What the S-DSP does:
The main CPU cannot touch ARAM: it uploads a program and data through the IPL boot ROM, then talks to that program through four ports.
| Register | Size | Purpose |
|---|---|---|
| A | 8-bit | Accumulator |
| X | 8-bit | Index register |
| Y | 8-bit | Index register (pairs with A for 16-bit) |
| SP | 8-bit | Stack pointer (page 1) |
| PC | 16-bit | Program counter |
| PSW | 8-bit | Status flags |
| Address | Purpose |
|---|---|
| $0000-$00EF | Zero page (fast access) |
| $00F0-$00FF | Hardware registers |
| $0100-$01FF | Stack |
| $0200-$FFBF | Program, data, samples, echo ring |
| $FFC0-$FFFF | IPL ROM (boot code) |
The sound driver, the samples and the echo ring share the 64 KB. The SDK's drivers and what they leave for samples: Music with SNESMOD and Samples, Voices and the Raw APU.
| SNES side | SPC700 side | Purpose |
|---|---|---|
| $2140 | $F4 | Port 0 |
| $2141 | $F5 | Port 1 |
| $2142 | $F6 | Port 2 |
| $2143 | $F7 | Port 3 |
Each side reads what the other wrote. Use 8-bit writes to the ports. The official manual (Book 1, §3-9-6) warns that a 16-bit write to $2140/$2141 can also write $2143; the mechanism is disputed on nesdev, so treat it as a caution rather than a measured fact — 8-bit writes are safe either way.
At reset the SPC700 runs its boot ROM, which takes blocks from the main CPU (anomie's SPC700 doc, IPL Boot ROM):
The SDK's drivers do this for you; writing your own SPC700 program is the raw APU path of Samples, Voices and the Raw APU.
The SPC700 reaches the DSP indirectly: the register number goes to $F2, the value is read or written at $F3.
| Reg | Name | Bits | Description |
|---|---|---|---|
| x0 | VOLL | 8 | Left volume (signed) |
| x1 | VOLR | 8 | Right volume (signed) |
| x2 | PL | 8 | Pitch low byte |
| x3 | PH | 6 | Pitch high bits (14-bit total) |
| x4 | SRCN | 8 | Sample source number |
| x5 | ADSR1 | 8 | ADSR enable, decay, attack |
| x6 | ADSR2 | 8 | Sustain level, sustain rate |
| x7 | GAIN | 8 | Envelope when ADSR is off |
| x8 | ENVX | 8 | Current envelope (read-only) |
| x9 | OUTX | 8 | Current output (read-only) |
| Reg | Name | Description |
|---|---|---|
| 0C | MVOLL | Main volume left |
| 1C | MVOLR | Main volume right |
| 2C | EVOLL | Echo volume left |
| 3C | EVOLR | Echo volume right |
| 4C | KON | Key on (start voices) |
| 5C | KOF | Key off (release voices) |
| 6C | FLG | Flags (mute, echo write, noise rate) |
| 7C | ENDX | Sample end flags (read-only) |
| 0D | EFB | Echo feedback |
| 2D | PMON | Pitch modulation enable |
| 3D | NON | Noise enable |
| 4D | EON | Echo enable |
| 5D | DIR | Sample directory (×$100) |
| 6D | ESA | Echo ring start (×$100) |
| 7D | EDL | Echo delay (×16 ms, ×2 KB) |
| xF | COEF | FIR filter coefficients |
The 14-bit pitch is a 2.12 fixed-point rate: $1000 plays the sample at 32 000 Hz, its own speed if it was recorded at 32 kHz. The rate is pitch × 32000 / $1000 Hz, up to $3FFF, almost two octaves above $1000 (SNESdev wiki, S-DSP registers, VxPITCH). One octave is a factor 2: a sample tuned to C at $1000 gives the A above it near $1AE9.
FLG bits 0-4 set the noise rate for every voice that has its NON bit: $00 stops it, $10 is 500 Hz, $1F is 32 kHz.
BRR (bit rate reduction) is an ADPCM format: blocks of 9 bytes, each holding 16 samples of 4 bits.
| Filter | a | b | Use |
|---|---|---|---|
| 0 | 0 | 0 | No prediction |
| 1 | 0.9375 | 0 | Simple prediction |
| 2 | 1.90625 | -0.9375 | Strong prediction |
| 3 | 1.796875 | -0.8125 | Moderate prediction |
A loop point falls on a block boundary, so it is a multiple of 16 samples.
DIR gives the directory's page (×$100). Entry n (the SRCN of a voice) is 4 bytes:
| Offset | Content |
|---|---|
| +0 | Sample start address (16-bit) |
| +2 | Loop address (16-bit) |
With ADSR1 bit 7 set, the voice follows attack, decay, sustain, then release at key off:
The rates are indices into a fixed table of the chip, not times. Attack rises linearly (rate 15 is the fastest), decay falls exponentially to the sustain level, sustain keeps falling exponentially at its own rate (0 holds the level), and release, after key off, falls linearly at a fixed speed of 8 per sample (fullsnes, DSP ADSR/Gain Envelope; SNESdev wiki, DSP envelopes).
With ADSR off, GAIN drives the envelope:
| Bits | Mode |
|---|---|
| 0vvv vvvv | Direct: hold the envelope at v × 16 |
| 100r rrrr | Linear decrease at rate r |
| 101r rrrr | Exponential decrease |
| 110r rrrr | Linear increase |
| 111r rrrr | Bent increase (fast, then slow near the top) |
The echo ring takes EDL × 2 KB of ARAM from page ESA, and delays the sound by EDL × 16 ms: EDL 15 is 240 ms and 30 KB. The DSP writes the ring continuously while echo writing is on (FLG bit 5 clear), so anything else placed there is overwritten: plan ARAM around it.
| Register | Example value | Effect |
|---|---|---|
| ESA | $40 | Ring at $4000 |
| EDL | $02 | 32 ms delay, 4 KB ring |
| EFB | $60 | Moderate feedback |
| EVOLL/EVOLR | $40 | Echo at half volume |
The FIR filter's eight coefficients (COEF, $0F-$7F) shape the echo: 127, 0, 0, 0, 0, 0, 0, 0 passes it unchanged; 32, 32, 32, 32, 0, 0, 0, 0 is a low-pass.
| Resource | Link |
|---|---|
| Fullsnes, APU | https://problemkaputt.de/fullsnes.htm#snesapudsp |
| SNESdev wiki, S-DSP registers | https://snes.nesdev.org/wiki/S-DSP_registers |
| SPC700 Reference | https://wiki.superfamicom.org/spc700-reference |
| nesdoug, SNES music | https://nesdoug.com/2020/06/14/snes-music/ |