sigma_audio
The chiptune synthesiser and bakery behind every sound in **Sigma Boy RPG**. Music and effects are generated here as raw f32 PCM and written out as `.soundClip` assets named `sig_<name>`.
sigma_audio
The chiptune synthesiser and bakery behind every sound in Sigma Boy
RPG. Music and effects are generated here as raw f32 PCM and written
out as .soundClip assets named sig_<name>.
local Audio = require("sigma_audio")
Audio.bakeAll() -- edit mode, once — writes every clip
Audio.bake("sfx_hit") -- rebuild one clip
Audio.trackNames() -- every clip this module can produce
Bake in edit mode. asset.create during play writes to the runtime
copy, which is discarded when play ends, so a play-mode bake silently
produces nothing durable.
What it produces
| Clip | Role |
|---|---|
sig_mus_menu | Title-screen loop. |
sig_amb_hallway / _cafeteria / _gym / _detention / _office | Per-zone ambient beds. |
sig_mus_battle / sig_mus_boss | Battle loop and its darker boss variant. |
sig_mus_victory | Ending sting. |
sig_sfx_hit / _crit / _heal / _levelup / _auraloss / _bell / _menumove / _confirm / _cringe | One-shots. |
sig_sfx_mog | The MOG stinger. |
How it synthesises
M.render(spec) mixes a track: a voices list of monophonic note runs,
each with a wave (square / pulse / saw / tri / sine), an ADSR
envelope, an octave offset and a gain, plus an optional drums pattern
string (k kick, s snare, h hat, - rest). Notes are { midi, beats } and loop until the track length is filled. The mix is soft
clipped and edge faded.
Effects go through M.sfx, where each entry builds its buffer directly
from three primitives: sweep (a pitch glide), blip (a short note at a
point in the clip), and burst (decaying noise).
Noise is generated from a seeded LCG, so a rebuild is sample-identical.
Everything renders at 22 050 Hz mono and is encoded to Opus by the
soundClip type.
Scoped to this part · feeds back into the world's score.