Skip to content

Latest commit

 

History

History
326 lines (247 loc) · 11.4 KB

File metadata and controls

326 lines (247 loc) · 11.4 KB

Danzig Documentation Index

Complete documentation for the Danzig VST3 plugin framework in Zig.

Quick Navigation

🚀 Getting Started

🏗️ Architecture & Design

📚 Documentation By Topic

Installation & Setup

Quick Start

Core Concepts

API Reference

Plugin Development

Advanced Topics

  • Advanced Topics
  • Memory allocation strategies
  • SIMD optimization
  • Error handling
  • Multi-threading

Real-World Development

VST3 Deep Dive

Examples

Troubleshooting

  • Troubleshooting
  • Build issues
  • Runtime issues
  • Parameter problems
  • Performance issues

Recommended Learning Path

For Beginners (New to VST/Audio)

  1. Start: Danzig Complete Guide - Quick Start

    • 10-minute setup and first plugin
  2. Understand: Danzig Complete Guide - Core Concepts

    • Learn plugin lifecycle, parameters, allocators
  3. Learn API: Danzig Complete Guide - API Reference

    • Understand the Plugin class and utilities
  4. Build: Real-World Guide - Getting Started

    • Set up a project properly
  5. Explore Examples: Real-World Guide - Examples

    • Tremolo, Soft Clipper, Delay plugins
  6. Create Your Own: Follow Plugin Development Guide

For Intermediate Users (Some VST Knowledge)

  1. Review: VST3 Architecture

    • Understand why VST3 is complex, how Danzig helps
  2. Deep Dive: VST3 Architecture - COM

    • Learn what's happening under the hood
  3. Reference: API Reference

    • Use as needed for your project
  4. Optimize: Real-World Guide - Performance

    • Make your plugins efficient
  5. Distribute: Real-World Guide - Distribution

    • Package and share your creation

For Advanced Users (VST3 Experts)

  1. Architecture Review: VST3 Architecture - Complete

    • See how Danzig implements VST3 abstractions
  2. Extend Danzig: Read source code in src/danzig/

    • Add your own abstractions on top
  3. Advanced Examples: Real-World Guide - Optimization

    • SIMD, denormals, profiling
  4. Threading: Advanced Topics - Multi-threading

    • Lock-free UI communication

Document Quick Reference

Type: Tutorial + Reference Length: ~26 KB Topics:

  • Full installation and setup guide
  • Quick start in 10 minutes
  • Complete API reference
  • Plugin development walkthrough
  • Audio processing techniques
  • Parameter system deep dive
  • Build and deployment
  • Advanced topics
  • Troubleshooting

Best for: Learning Danzig from scratch, API reference, how to build different plugin types

Type: Technical Deep Dive Length: ~22 KB Topics:

  • VST3 vs other plugin formats
  • COM (Component Object Model) explained
  • GUIDs and interface IDs
  • Virtual tables (VTables)
  • IUnknown pattern
  • Multi-interface objects
  • Implementing VST3 in Zig
  • Complete working example
  • Why COM/VST3 is complex

Best for: Understanding VST3 architecture, learning COM, implementing custom interfaces

Type: Practical Guide Length: ~18 KB Topics:

  • Project setup templates
  • Common pitfalls and how to fix them
  • 3 complete, real-world plugin examples
  • Performance optimization techniques
  • Testing strategies
  • Debugging techniques
  • Multi-threading considerations
  • Distribution and packaging

Best for: Avoiding mistakes, practical implementation, complete working examples, performance tuning


Code Examples by Plugin Type

Utility Plugins

Effects

Generators & Processors


API Cheat Sheet

Creating a Plugin

const MyPlugin = struct {
    plugin: danzig.Plugin,
    
    pub fn init(allocator) !*MyPlugin {
        const self = try allocator.create(MyPlugin);
        self.plugin = danzig.Plugin.init(allocator);
        return self;
    }
};

Adding Parameters

try plugin.addParameter(.{
    .id = 0,
    .minValue = -48.0,
    .maxValue = 12.0,
    .defaultValue = 0.0,
});

Processing Audio

pub fn process(self, inputs, outputs, channels, samples) void {
    for (0..channels) |ch| {
        for (0..samples) |s| {
            outputs[ch][s] = self.dsp(inputs[ch][s]);
        }
    }
}

Handling Parameters

pub fn setParameterNormalized(self, id, normalized) void {
    const plain = danzig.denormalize(normalized, -48.0, 12.0);
    // Use plain value
}

Building

bash gen_build_spec.sh
zig build
# Output: zig-out/lib/libplugin_name.dylib

External Resources

VST3 & Audio

Zig Language

VST3 + Zig Articles


Support & Contribution

Finding Answers

  1. Quick lookup: Check API Reference
  2. How-to: Check Real-World Guide
  3. Understanding concepts: Check VST3 Architecture
  4. Debugging: Check Troubleshooting
  5. Examples: Check Real-World Examples

Common Questions

Q: How do I add a parameter? A: See Parameter System and Real-World Guide - Example 1

Q: How do I process audio? A: See Audio Processing and Real-World Examples

Q: What's happening under the hood? A: See VST3 Architecture

Q: How do I avoid common mistakes? A: See Common Pitfalls

Q: How do I optimize for performance? A: See Performance Optimization


Document Versions

  • Danzig Version: 1.0
  • Zig Requirement: 0.14.0+
  • VST3: 3.7.0+
  • Last Updated: 2026-03-15
  • Documentation Status: Complete ✅

Quick Links


Happy plugin development! 🎵