Tracker music with transport controls, and sound effects over it, via SNESMOD.
More...
Tracker music with transport controls, and sound effects over it, via SNESMOD.
Plays an Impulse Tracker (.it) module through the SPC700 sound processor using the SNESMOD library, with transport controls (play, stop, pause/resume, volume, fade out), and fires sound effects over the music.
The soundbank holds two modules: the music (nocturne) and a module that is only a set of instruments (neo_lumen_sfx), whose samples become the sound effects. Effects are uploaded into the SPC700's RAM after the module, in the room the module and its echo buffer leave, and the driver does not check: an effect past the room is copied over the echo buffer, which the echo then overwrites. opensnes-music inspect gives the room (the README has the figures); the four effects fit.
The music and the instruments are composed and synthesized for OpenSNES (devtools/audio_assets); the effects are Kenney's (kenney.nl, CC0). The program began as PVSnesLib's "music" and "effects" examples by alekmaul.
- SNES Concepts
- SPC700 audio: separate coprocessor with 64 KB audio RAM
- SNESMOD workflow: init → setSoundbank → loadModule → play
- Per-frame snesmodProcess(): sends the queued commands (play, stop, volume, sound effects) to the SPC700, which plays the patterns itself
- Module volume and fade control
- Sound effects: snesmodLoadEffect() uploads a sample, snesmodPlayEffect() plays it on a free voice, with volume, pan and pitch
- SPC RAM is shared: module, samples, echo buffer and effects
- What to Observe
- Music plays immediately on boot
- A=play, B=stop, X=pause/resume, L/R=volume, START=fade out
- LEFT/RIGHT choose an effect, UP/DOWN its pitch, Y plays it over the music
- Modules Used
- console, sprite, dma, input, background, text
- See also
- snesmod.h