Functions | |
| u8 | snesmodLoadEffect (u16 sfxIndex) |
| Load a sound effect from the soundbank. | |
| u8 | snesmodPlayEffect (u16 effectId, u8 volume, u8 pan, u16 pitch) |
| Play a sound effect. | |
Load a sound effect from the soundbank.
Loads a single source/sample for use as a sound effect.
| sfxIndex | Source index in the soundbank |
Play a sound effect.
Triggers a sound effect, potentially interrupting module playback on one channel temporarily.
| effectId | Effect slot ID (from snesmodLoadEffect or soundbank.h), 0-15: the driver command carries it in four bits |
| volume | Volume level (0-127; the command keeps its top 4 bits, so 16 steps) |
| pan | Pan position (0=left, 128=center, 255=right; 16 steps) |
| pitch | Playback rate, 0-15: use SNESMOD_PITCH_LOW (4, 16 kHz), SNESMOD_PITCH_NORMAL (8, 32 kHz) or SNESMOD_PITCH_HIGH (12, 48 kHz). NOT the $1000-style pitch of audio.h: only the low four bits are sent (the routine masks the rest, 2026-09-20 — it used to OR the whole low byte into the effect-id nibble, so 0x1000 played at rate 0 and 0x1800 too). |