Getting Started
What you need installed, then five minutes from clone to an installed bundle.
Prerequisites
- Zig 0.14.1 or 0.15.2. Both are tested in CI on every push. The sources
use spellings valid in both: the
root_modulebuild API,callconv(.c), andnet.Stream.read. Other versions may work and are unsupported. - macOS for the VST3 bundle, the
install-vst3step, and the GUI example. - Xcode command line tools, for
lipoand the macOS SDK. - A VST3 host if you want to scan the bundle.
Nothing else. There is no CMake, no vendored SDK, and one optional Zig
dependency (webview) that is fetched lazily and only when you build the GUI
example.
Install Zig with Homebrew or from ziglang.org:
brew install zig # currently 0.15.2
# or download 0.14.1 / 0.15.2 from https://ziglang.org/download/
Quickstart
Five minutes, from clone to an installed bundle.
1. Clone and run setup
git clone https://github.com/godofecht/danzig
cd danzig
./setup.sh
setup.sh checks your Zig version, builds, runs the tests, builds the universal
bundle, and prints where it landed. It exits non-zero if any of that fails, and
it is safe to run repeatedly. Add --release for a ReleaseFast build.
If you prefer to do it by hand, the four commands are below.
2. Build
zig build
Build Summary: 29/29 steps succeeded
3. Test
zig build test --summary all
Build Summary: 9/9 steps succeeded; 35/35 tests passed
4. Package the bundle
zig build vst3
lipo -info zig-out/DanzigGain.vst3/Contents/MacOS/DanzigGain
Architectures in the fat file: zig-out/DanzigGain.vst3/Contents/MacOS/DanzigGain are: x86_64 arm64
5. Install it
zig build install-vst3
This removes any previous copy and writes a fresh one to
~/Library/Audio/Plug-Ins/VST3/DanzigGain.vst3. Verify it:
lipo -info ~/Library/Audio/Plug-Ins/VST3/DanzigGain.vst3/Contents/MacOS/DanzigGain
Architectures in the fat file: /Users/you/Library/Audio/Plug-Ins/VST3/DanzigGain.vst3/Contents/MacOS/DanzigGain are: x86_64 arm64
6. Load it in a DAW
Restart your DAW so it rescans the plugin folder. The scan finds the bundle,
instantiates the class, and lists "Danzig Gain" under Superelectric. It also
passes pluginval at strictness level 5 (see Current state).
The bundle structure, the universal binary, the Info.plist, and the ad-hoc
signature are verifiable:
codesign -dvv zig-out/DanzigGain.vst3
Executable=.../zig-out/DanzigGain.vst3/Contents/MacOS/DanzigGain
Identifier=libDanzigGain_arm64.dylib
Format=bundle with Mach-O universal (x86_64 arm64)
CodeDirectory v=20400 size=242 flags=0x20002(adhoc,linker-signed) hashes=4+0 location=embedded
Signature=adhoc
7. Hear the DSP without a DAW
zig build run-minimal
danzig-minimal: one parameter, one line of DSP
Trim range is -24 to +24 dB, 20 ms smoothing, 48 kHz.
full cut normalized 0.00 -> -24.00 dB (output 0.0631)
unity normalized 0.50 -> 0.00 dB (output 1.0000)
full boost normalized 1.00 -> 24.00 dB (output 15.8473)
Copy examples/danzig-minimal/root.zig to start your own plugin.
That file is the template. Copy it and start editing process.