Oh noes, it ate SFXR!
Ultra-lightweight SFXR-like 3D Sound Effect Synthesizer inspired by ChipTone
Built with C++20, Google Filament 3D PBR, LabSound WebAudio, and Lua 5.4 scripting.
eatSFXR is a focused proof-of-concept (PoC) for building a 3D procedural sound effect generator inspired by ChipTone (by SFB Games).
- ChipTone-like SFX Generation: Procedural sound generation for retro 8-bit sound effects (jump, explosion, pickup, powerup, synth pads, hit, blip, laser).
- Minimal Footprint: Keep build sizes ultra-compact for WASM/Web and native execution without heavy framework bloat (e.g., Flutter binaries).
- Lua Scripting Core: Dynamic patch editing, sound modulation, preset generation, and macro controls driven by Lua 5.4.
- Interactive 3D Interface: PBR physical synth interface rendered via Google Filament with orthographic 3D projection.
- 3D Renderer: Google Filament (C++) — Orthographic 3D Camera Projection (
filament::Camera::Projection::ORTHO), PBR materials, custom shaders, dynamic lighting. - Audio Engine: LabSound (C++) — Native C++ WebAudio graph (
AudioContext, synth nodes, oscillators, envelopes, filters, gain, biquad filter nodes, custom noise/wave generators). - Scripting Core: Lua 5.4 +
sol2— Scriptable SFX parameters, randomization algorithms, patch presets, and Lua-driven sound triggering. - Dual-Mode Transpiler:
src/LuaTranspiler.hppfor optional AOT transpilation of Lua preset triggers into direct native C++ calls. - Build System:
CMake 3.25++Ninja+vcpkg+ Emscripten (emcc).
Designed around LabCore's Pluggable Dual-Pipeline Architecture for 2D/3D UI text and rendering:
┌────────────────────────┐
│ UTF-8 Text Stream │
└───────────┬────────────┘
│
┌───────────┴────────────┐
│ ITextShaper │
└─────┬────────────┬─────┘
│ │
Pipeline A (Light) │ │ Pipeline B (Rich i18n)
┌──────────────────────┴┐ ┌┴─────────────────────────┐
│ NanoVG / stb_truetype │ │ HarfBuzz + FreeType │
│ (~50 KB footprint) │ │ (RTL, Arabic, Indic, │
│ Basic Latin, Kerning, │ │ Ligatures, Color Emoji│
│ 1-bit LCD Bitmasks │ │ OpenType Shaping) │
└──────────────────────┬┘ └┬─────────────────────────┘
│ │
└─────┬──────┘
▼
┌────────────────────────┐
│ IGlyphRasterizer │
│ (GPU Texture Atlas) │
└───────────┬────────────┘
▼
┌────────────────────────┐
│ Google Filament Quads │
└────────────────────────┘
- Pipeline A (Lightweight Profile — Default):
NanoVG/stb_truetype+ Canvas 2D API abstraction.~50 KBbinary overhead. Ideal for embedded synth LCD displays, web widgets, and memory-constrained builds.
- Pipeline B (Rich i18n Profile — Opt-in CMake Flag):
HarfBuzz+FreeType(+ SheenBidi) for full internationalization, RTL text, complex scripts, and color emoji.
To compile to WebAssembly and start the dev server:
.\build.ps1This PowerShell script:
- Configures Emscripten SDK toolchain (
emcc,emcmake,emmake). - Builds
eatsfxr.wasm/eatsfxr.js. - Launches a local web server on port
8080. - Opens
http://localhost:8080/index.htmlin your browser.