Repository navigation
Building From Source
This page gets you from a fresh clone to a built firmware, a built native library and a generated Unity package. It lists the tools you need and, for each build command, what it produces and what you see.
All commands run from the repository's root. On Windows use Git Bash for every sh command.
| Tool | Version used here | Needed for |
|---|---|---|
| Git Bash | any | every sh command (on Windows) |
| VIBE FM SDK | a clone in .tools/vibe-fm-sdk
|
builds the firmware; its wasmtest and vibe-check run the checks |
| Zig | 0.13.0, in .tools/zig-*, on the PATH, or named in ZIG=
|
the C compiler: the firmware, the DLL, the stress test |
| Node | 18 or later (22.14 here) | the checks, docs/shots.mjs
|
| Python | 3 (3.13 here) | strips the .wasm; with Pillow: the figures |
| .NET SDK | one that builds net9.0 (10.0 here) |
tests/dotnet |
| Unity | 6000.3.8f1, the only version ever run | the two Unity test projects |
| ffmpeg, numpy | on the PATH | only the videos and the package script |
You do not need all of it at once:
| You want to | You need |
|---|---|
| build the firmware and run its checks | Git Bash, the SDK, Zig, Node, Python |
| build the DLL | Git Bash, Zig |
| run the .NET tests | the two rows above, and the .NET SDK |
| run the Unity tests | Unity |
Get the SDK once:
git clone https://github.com/Vibe-FM-SDK/vibe-fm-sdk.git .tools/vibe-fm-sdkZig is one folder with no installer. Take 0.13.0 from https://ziglang.org/download/ and unpack it into .tools/,
so that there is .tools/zig-<its name>/zig.exe (or zig without .exe). Both build scripts look there first.
.tools/ is git-ignored and not ours: never edit it. New words (SDK, host, Zig, wasmtest, vibe-check):
Glossary.
flowchart LR
core["core/*.h"]
fwsrc["sfx-forge/"]
nsrc["native/sfx_native.c"]
b1["sh build.sh"]
b2["sh native/build.sh"]
wasm["build/sfx-forge.wasm<br/>build/sfx-forge.json<br/>build/sfx-forge.zip"]
dll["Runtime/Plugins/x86_64/sfxforge.dll"]
b3["python tools/make_unity_package.py"]
repo["../unity-sfx-forge"]
core --> b1
fwsrc --> b1
b1 --> wasm
core --> b2
nsrc --> b2
b2 --> dll
wasm --> b3
dll --> b3
b3 --> repo
sh build.sh # build + all checks. About 30 seconds
sh build.sh quick # build onlyWhat build.sh does, in order:
- It finds the SDK (
.tools/vibe-fm-sdk, orVIBE_SDK=/path/to/sdk) and Zig. - It copies
sfx-forge/andcore/into the SDK, builds there with the SDK'stools/build.sh, and takes the copies out again. - It copies
sfx-forge.wasm,sfx-forge.jsonandsfx-forge.zipintobuild/. - It runs
tools/strip_wasm_debug.pyon the.wasmand the zip. The SDK's build leaves debug sections with this machine's full paths in them; the script takes them out. The code is untouched. - With
quickit stops here. Otherwise it runsvibe-checkand every check (Running The Tests).
What you see when it is right: exit code 0, and 25 lines of the output say PASSED.
What you get: build/sfx-forge.wasm, which you drop onto the SDK's emulator in a browser
(https://play.thefirmwarehub.com/), and build/sfx-forge.zip, which you drop onto the VIBE FM plugin's window.
What was tried on which host: What Is Tested.
To build against another checkout of the SDK:
VIBE_SDK=/path/to/sdk sh build.shsh native/build.shIt compiles native/sfx_native.c (which includes core/) with zig cc for Windows x64 and writes
unity/com.catsplat.sfxforge/Runtime/Plugins/x86_64/sfxforge.dll. It prints the DLL's ls -l line.
The same source gives the same DLL but for the build time in its header. So the file shows as changed in git after
every build. Commit it only when core/ or native/ changed; otherwise git checkout it.
Rebuild it after any change in core/ or native/, before you run tests/dotnet: those tests load the
committed DLL, and an old one passes tests it should fail.
python tools/make_unity_package.py [target folder] # default: ../unity-sfx-forgeIt writes the standalone package repository from nothing: Runtime, Editor, the showcase as Samples~/Showcase,
the manuals, the videos with previews, the built firmware, the front page and every .meta. It builds in a folder
beside the target and replaces the target only when every check passed. It never starts Unity.
It stops with a named error when something it needs is missing. The usual ones:
| It needs | Get it with |
|---|---|
build/sfx-forge.zip, with the version the script expects |
sh build.sh |
ffmpeg and ffprobe on the PATH; the SDK and Zig in .tools
|
install them |
the five videos in videos/, each as long as the script's VIDEOS table says (within 2 seconds) |
they are committed |
| exact lines of the manuals and READMEs that it rewrites | after editing a manual, update the script's copy of the line it names |
The full list: the maintainer's guide.
node docs/shots.mjs # the firmware's screenshots into out/doc (after sh build.sh)
python docs/figures.py # the manual's pictures into docs/img (needs Pillow)Run both; git diff --stat docs/img is empty when nothing visible changed. The wiki's own pictures are made by the
scripts in wiki/figures/: Editing This Wiki.
sha256sum build/sfx-forge.wasm gives the same hash before and after a change that only moves text. A hash belongs
to one state of the source: any change to the code gives another, and another SDK or another Zig may give another
hash for the same source. So compare a hash only with one you took yourself, just before your change.
| You see | Cause |
|---|---|
VIBE FM SDK not found at ... |
no clone in .tools/vibe-fm-sdk, and VIBE_SDK is not set |
folders sfx-forge/ and core/ inside the SDK |
a build was killed. The next run removes them first |
sfxforge.dll shows as modified in git though you changed nothing |
the build time in its header. git checkout it |
tests/dotnet prints FAIL out/midi.json missing: run sh build.sh first
|
do that: sh build.sh writes the file |
- Running The Tests: every suite and what a pass looks like.
- Repository Map: what the folders are.
- Release Checklist: the steps of a new firmware version.
- Unity Porting The Native Library: the DLL on another platform.
SFX FORGE, firmware 1.7.2 · Home · Glossary · What Is Tested · the pages are kept in the repository's wiki/ folder: Editing This Wiki
Start
Device
- Quick Start
- Controls And Pages
- Make A Sound
- The Five Engines
- Make A Beat
- Recording
- Finer Grids
- Time Signatures
- Perform
- Song And Arrangement
- Layers And Intensity
- Automation
- Mixer And Effects
- The Stage
- Saving And Reset
- Cheat Sheet
Unity: first steps
- Install
- Quick Start
- Concepts
- Choosing A Route
- One Shots
- Live Voices
- Held Sounds
- Variations
- Presets And Patches
Unity: music
Unity: link and tools
Unity: in practice
- Recipes
- Recipes: Music
- Recipes: Link
- Showcase Walkthrough
- Copy The Showcase Pattern
- Troubleshooting
- Testing Your Audio
Unity: reference and extending
Internals
- Architecture Overview
- Repository Map
- Sound Engine
- Patch Format
- Song Format
- Link Protocol
- Firmware Internals
- Add A Page Or Key
- Add An Engine
- Add A Setting
- Building From Source
- Running The Tests
- Release Checklist
About this wiki