Search guides and the APICtrl K
  1. API reference
  2. Formats and wrappers

au_wrapper.h

The Audio Unit (AUv2) format wrapper, for macOS.

#include <sonore/au_wrapper.h>
On this page

Design notes

Compiled and validated on macOS since 2026-09-01: the SDK workflow (.github/workflows/sdk.yml, a macos-14 runner) builds every AU here and Apple's auval passes all six examples with zero warnings: instantiation, parameters, render, state, bypass, latency, each through the selectors below. It took nine rounds of fixes to get there, and every one of them is now a comment in this file: a wrapper that has never been run is not "probably fine", it is unmeasured. What auval does NOT open is the CocoaUI view (au_view.h), so the editor path is compiled but still unrun.

Written against the C AudioComponent API rather than Apple's AUBase C++ classes, because AUBase was removed from modern Xcode and dragging in a copy would re-create the framework dependency this SDK exists to avoid. A modern AUv2 is a factory function returning an AudioComponentPlugInInterface whose Lookup() hands back an implementation per selector: plain C function pointers, which is the same shape CLAP and VST3 already use here.

Include it AFTER clap_wrapper.h: that header owns the shared machinery (the DSP instance, parameters, state, the webview bridge) and this one adapts it, so one source file builds .clap, .vst3 and .component without drift.

Types 2

One Audio Unit instance: the shared Instance every format drives, plus what AUv2 adds on top -- the host's handle, the pull-model input sources, the property and render listeners, the host's transport callbacks and the channel widths the host declared per bus.

Built by Open inside the block the factory allocates and destroyed by Close; always reached through unitOf(), never by casting the dispatch pointer (see there for why). Render runs on the host's render thread and reads only the fixed-capacity lists here; everything that grows is sized at initialize().

The block OUR factory allocates. Apple's public headers stopped shipping AudioComponentPlugInInstance with the classic CoreAudio SDK (macOS CI's first compile of this file proved it) -- but the only ABI the system cares about is that the returned pointer's first bytes are the AudioComponentPlugInInterface. The rest of the block is ours; the layout mirrors Apple's so the hard-won addressing rule stays true: the instance storage begins AT the mInstanceStorage field.

Functions 48

Constants 2

↑↓ to move↵ to openEvery public name in the headers, and every guide