Loading...
Searching...
No Matches
main.c File Reference

Sound effect playback with pitch control via SNESMOD. More...

#include <snes.h>
#include <snes/snesmod.h>
#include <snes/text.h>
#include "soundbank.h"

Macros

#define NUM_EFFECTS   5
 Number of sound effects in the soundbank.
 

Functions

int main (void)
 Entry point — load effects, display controls, play on button press.
 

Detailed Description

Sound effect playback with pitch control via SNESMOD.

Demonstrates standalone sound effect playback through the SPC700 using SNESMOD, without any background music. Five instrument samples are loaded from a soundbank at startup. Each button triggers a different effect, and the D-pad left/right cycles between three pitch settings.

Ported from PVSnesLib "effects" example by alekmaul.

SNES Concepts
What to Observe
  • A/B/X/Y play different instrument samples
  • L/R play cowbell
  • LEFT/RIGHT change pitch (shown on screen)
Modules Used
console, sprite, dma, input, background, text
See also
snesmod.h

Macro Definition Documentation

◆ NUM_EFFECTS

#define NUM_EFFECTS   5

Number of sound effects in the soundbank.

Function Documentation

◆ main()

int main ( void  )

Entry point — load effects, display controls, play on button press.

Returns
Never returns