0017. Sound effects and music as synthesizer data
- Status: Accepted (2026-11-27, Phase 1b gate)
- Date: 2026-11-27
- Phase: 1
Context
Section titled “Context”The owner chose original art and audio made by Claude for the sample game (no downloaded packs). Recorded audio would need an external tool or a large generated WAV per sound, and the platform is AI-first: an AI tool should be able to read and tweak a sound (“make the jump higher-pitched”) as easily as a prefab.
Decision
Section titled “Decision”- A new asset type
synthpoints at a small JSON document (schemasynth.schema.json): either a sound (sfxr-style: wave, pitch slide, arpeggio, vibrato, envelope, low-pass) or a song (tracks of note patterns such as"C4 - E4 ."played in a sequence, plus a drum line withk s h). @ludrel/audiorenders them to buffers when the asset loads (renderSound,renderSong, 22 050 Hz mono, seeded noise so output is deterministic). Songs render as seamless loops.- Synth files are validated with the other documents: in dev, in tests and at build time.
- Recorded files (
audioasset type, decoded by the browser) remain supported for games that want them.
Consequences
Section titled “Consequences”- Sprout’s 11 sound effects and 3 songs weigh about 9 kB of JSON in total, and AI tools can edit every one of them.
- The sound is deliberately “chiptune”; realistic audio still needs recorded files.
- Rendering a 16 s song takes a few milliseconds on load; very long songs should be split or recorded instead.