Audio drivers: Difference between revisions

From SNESdev Wiki
Jump to navigationJump to search
mNo edit summary
(Update the table)
Line 12: Line 12:
|-
|-
! Sound effect channels
! Sound effect channels
| 8 || 2 || 2 || 2? || 8 || 2 || 4
| 8 || 2 || 2 || 2 || 8 || 2 || 4
|-
|-
! SFX/Music channel sharing
! SFX/Music channel sharing
Line 21: Line 21:
|-
|-
! Sound effect channel allocation
! Sound effect channel allocation
| Manual || Auto || Auto || ? || Auto || Auto? || Manual
| Manual || Auto || Auto || Manual || Auto || Auto? || Manual
|-
|-
! Music input format
! Music input format

Revision as of 20:00, 6 September 2024

An 'audio driver is a program that handles playing music and sound effects for a game running on a game console. In a SNES game, music is normally encoded into a sequence of notes that an audio driver then interprets, keeping track of timers in order to start and stop notes at the right times. The SNES has a dedicated processor for running audio drivers (the S-SMP) and the main program running on the 65c816 has to communicate with the audio driver on the S-SMP in order to ask it to play sound effects, switch which song is currently being played, and other tasks.

Audio drivers vary in what features they support and the way composers are intended to write music for them. Some audio drivers have streaming features, where the main program can provide new sample data or music sequence data during gameplay. Nintendo provided licensed developers with an audio driver named Kankichi-kun (known as N-SPC) that many game studios customized to their needs, but using it without a license would be copyright infringement. Thankfully there are several audio drivers that are licensed for homebrew game use.

Quick driver comparison
SNESGSS SNESMOD Terrific Audio Driver qSPC XMSNES SNES-ProTrackerPlayer Super Kannagi Sound
Music channels 8 8 8 8 8 8 8
Sound effect channels 8 2 2 2 8 2 4
SFX/Music channel sharing No Yes Yes No Yes ? Yes?
Sequenced sound effects Yes No Yes Yes No No No
Sound effect channel allocation Manual Auto Auto Manual Auto Auto? Manual
Music input format Custom tracker IT file MML MML MOD/S3M/XM file MOD file MOD/S3M/XM/IT file?

SNESGSS

SNESGSS uses its own custom tracker, which can show how much audio RAM is in use as the composer works on the song.

  • Arbitrary number of music and sound effects, but cannot share channels between music and sound effects at the same time
  • Supports the SNES's ADSR envelopes
  • Audio RAM holds the driver, instrument data, sound effect sequences, and a single song. The main program uploads the data for a new song whenever it wants to play a different one.
  • Sequenced sound effect support
  • Audio streaming feature

See https://nesdoug.com/2020/06/14/snes-music/ for a guide, as well as https://github.com/NovaSquirrel/snesgss-extended which is a fork that adds new features (but has unresolved bugs in its exporter). There is a known bug which can cause the console to lock up[1] but there are patched versions which fix this.

SNESMOD

SNESMOD plays Impulse Tracker files, with limitations on what effects are supported. See snesmod_music.txt for more details.

  • Sound effects are just samples, but sequenced sound effect support is available in a patched version
  • Audio streaming feature

See https://nesdoug.com/2022/03/02/snesmod/ for a guide.

Terrific Audio Driver

Terrific Audio Driver plays songs written with MML, and it provides its own MML editor which allows composers to preview the music while working on it.

  • Can play music on all 8 music channels, with 2 channels interrupted as needed for sound effects
  • Elaborate sound effect support
    • Can be played with different panning
    • Sequenced sound effect support
    • Each sound effect can be limited to playing on one channel at a time, so that sound effects that will play frequently won't take up both channels
    • Each sound effect can be marked as uninterruptible, so sounds like voice samples can be guaranteed to play to completion
    • Priority system, so that background effects like footsteps and water droplets can be interrupted
  • Sound effects can be played with different panning, and
  • Supports the SNES's ADSR envelopes
  • Vibrato and portamento
  • Has a custom audio loader that is faster than the built-in loader
  • Can load audio data across several frames, allowing the game to do it in the background while it does other tasks
  • ca65 and pvsneslib APIs

qSPC

qSPC plays songs written with MML. It was used in Nekotako and Dottie dreads nought.

XMSNES

XMSNES was made by the same person as SNESMOD and seems to be an older driver.

SNES-ProTrackerPlayer

SNES-ProTrackerPlayer is a MOD player by snesdev0815.

Super Kannagi Sound

Available as a part of Kannagi's SDK, SNDK

  • Can play music on all 8 channels, with the ability to play sound effects on 4 channels
  • Can fit 52KB of samples at once
  • Reads XM, IT and S3M formats, but doesn't handle effects
  • Has a fast loader