AudioUnit v2 exports¶
Topics in this guide
Generic native adapter (0.1.0 prototype)¶
adapters/auv2 builds any local product exporting ravet_plugin_v1() as an
AUv2 component, using Apple's external AudioUnitSDK directly. Effects derive
from AUEffectBase, instruments from MusicDeviceBase, and audio-backed MIDI
effects from AUMIDIEffectBase. This implements the native AU choice in
decision 0281; there is no VST3 module
inside this component.
CARGO_BUILD_JOBS=2 python3 scripts/bundle-au.py --plugin delay \
--audio-unit-sdk /path/to/AudioUnitSDK --validate
This builds only the chosen product and the native adapter. The SDK path must
be an Apple source checkout with include/AudioUnitSDK and src/AudioUnitSDK
(1.4.0 was exercised), rather than JUCE's flattened SDK snapshot. Fetch it with
python3 scripts/fetch-audio-unit-sdk.py "$HOME/Library/Application Support/ravet/sdks/AudioUnitSDK"
which downloads Apple's AudioUnitSDK-1.4.0 tag from GitHub, checks a SHA-256
pin before opening it, and extracts only include/AudioUnitSDK,
src/AudioUnitSDK and the Apache-2.0 LICENSE.txt. Point [sdks] audio_unit
in a ravet-sdks.toml at the result (for the per-user file
above, audio_unit = "sdks/AudioUnitSDK") so builds need no flag. Nothing is
vendored in this repository. CMake, Xcode's command-line tools and
Python 3.11 or later are required. The default build architecture is the current
machine's architecture; recorded execution is macOS arm64 only. The
support matrix separates the component/validator receipts
from the manual Delay run in Logic Pro (version not recorded).
For a separate consumer, pass --manifest-path /path/to/product/Cargo.toml.
Its cdylib must use export_plugin! with ravet-plugin feature native
(umbrella plugin-native). Alternatively, --product-library /path/to/product.dylib
uses an already built trusted local library. The build runs a small metadata
tool that loads this library and calls ravet_plugin_v1; use trusted binaries.
--build-dir selects the output directory. The default delay output is
target/au-native/delay/AU/ravet_au.component.
The product table supplies the AudioComponents name, version and type/subtype/
manufacturer, parameter IDs, channel layouts and editor class identity. The
component contains its product dylib in Contents/Frameworks, with a unique
install name and a relative loader path. It includes RAVET/Apple licence
notices and receives an ad hoc signature. Production signing remains a consumer
responsibility. --native-editor is a legacy-reference option; the native
adapter automatically advertises an editor when the table declares one.
Parameters, audio and state¶
AU parameters use the product's permanent host IDs and physical values. Ranges, units, automation/read-only/hidden flags and logarithmic display hints come from the table. Integer-spaced stepped ranges expose indexed value strings; other stepped ranges retain their physical ranges and snap through the table. String conversion properties call the product's text functions.
Main-thread host changes call set_value, so a state save before rendering
includes them. Non-main parameter changes, scheduled immediate/ramped parameters
and MIDI input enter a fixed 1,024-event render queue. Scheduling/MIDI producers
must be serialized with rendering, as must stopped prepare/reset/retirement.
Schedule lists preflight completely before queue mutation. Ramps expand to
per-sample physical events within this bound, with a boundary endpoint carried
to offset zero of the next render. Events beyond the current render boundary
reject the block; multi-block ramps are not implemented. Same-offset order is
preserved. The table owns automation/bypass policy and denormal handling.
The current audio profile is one main bus, planar native f32, 1..65,536 frames,
0..64 input channels and 1..64 output channels. All advertised layouts must
agree on whether an input bus exists. Mono packed f32 is also accepted. The
product's auxiliary buses
follow as extra input/output elements, named after the bus, with fixed channel
counts and the main element's sample rate. An unconnected or failing auxiliary
input is silent (a failing main input still faults the block); output elements
are rendered together once per render cycle. Without a main input, an
auxiliary input becomes input element 0 and the advertised channel table
reports its channel count as the input count, because hosts and auval read
input element 0 as the main input. Effect-based units without a main input
(MIDI effects, aumf) skip the SDK effect base's initialization, which reads
input element 0. The adapter needs AudioUnitSDK 1.4 or later; CMake stops with
a message on older copies (detected by GetBufferListOrError). There is no f64
negotiation. The product may
impose tighter limits. Malformed blocks fail with silence on supported output
prefixes; backing tails remain outside the processing range.
ClassInfo and ClassInfoFromDocument dictionaries store the unchanged versioned
save_state envelope as CFData under RAVET, alongside standard component
identity and preset-name keys. Restore validates the dictionary and delegates
all-or-none decoding/import/migration to load_state. The bypass property maps
to bypass_index and is included in complete state recall. This differs from
the historical VST3 wrapper's separate bypass preservation below.
Latency and tail are cached from timing after preparation and between render
calls. Changes schedule main-run-loop property notifications, including
latency_changed and tail changes without latency changes. Infinite tails use
positive infinity. Host beat/tempo, signature and transport callbacks are
validated through RavetAuTransport.hpp at block start. A transport sample
position within Float64 residue of an integer (REAPER reports, for example,
3584.0000000000005) is canonicalized to that integer. A malformed tuple,
including a genuinely fractional position, still makes the block output silence
and return an error without calling the product
(decision 0294). Short MIDI input maps
to native MIDI events; declared note output uses the bounded
kAudioUnitProperty_MIDIOutputCallback path. Missing/rejecting output callbacks
do not undo audio or replay events; callback changes require an uninitialized
unit. SysEx, MIDI 2, MusicDevice StartNote/StopNote,
factory-program catalogues and MIDI-only zero-audio layouts are not implemented.
Cocoa lifetime and validation¶
The Cocoa factory calls editor_open with VIEW_COCOA, resizes within the
product's bounds, and closes the editor before destroying the product. A 30 Hz
main-run-loop timer calls editor_idle, drains take_edits, and reports
begin/value/end gestures through AUEventListenerNotify. The NSView and timer
hold weak lifetime tokens. A host may retain the view after disposing the AU;
subsequent view resizing and destruction cannot reach the retired instance.
Control calls marked MAIN by the table are dispatched to the AppKit thread.
Hosts must provide a running main loop for these calls and notifications.
--validate runs in-process actual-component contracts; the supplied product
smoke fixture expects a stereo layout and, except for Evidence Synth, an editor. Other products can build
without this fixture. For the delay it also
checks the 120 BPM eighth-note impulse at sample 2,000 at 8 kHz, state saved
before render, complete bypass recall, offset-16 automation and dynamic tail.
It also replays REAPER 7.82's 48 kHz/512-frame calling pattern, with transport
samples one ulp off whole block starts: fixed 100 ms echoes must land at
exactly +4,800 and synced eighth-note echoes at 150 BPM at exactly +9,600. The
generic host callback reports 456 plus one ulp for every product.
The mock exercises effects, instruments and audio-backed MIDI effects:
python3 scripts/bundle-au.py --mock effect \
--audio-unit-sdk /path/to/AudioUnitSDK --validate
python3 scripts/validate-au-mock.py \
target/au-native/mock-effect/AU/ravet_au.component \
--log target/au-native/mock-effect/auval.log
# Repeat with --mock instrument or --mock midi and the corresponding directory.
The validator script accepts only the test identities aufx/RvT1/RvTs,
aumu/RvI1/RvTs and aumf/RvM1/RvTs, refuses to overwrite an existing component,
and removes its temporary user Components installation in finally. It retries
only asynchronous discovery failures. On macOS 27.0.1 arm64/Xcode 27.1, all
three returned exit 0, AU VALIDATION SUCCEEDED. Actual-component contracts
also passed three retained-view disposal cycles per variant and the real delay.
See work status for exact commands and evidence. These results
do not establish a DAW, device, callback deadline, sandbox, commercial-signing
or x86_64 support claim.
Historical gain and performance references (0.0.1)¶
The historical macOS AUv2 component uses the external Steinberg AU wrapper and Apple AudioUnitSDK, embedding the same Rust-backed VST3 gain reference. SDKs remain outside this repository. This is an exercised reference adapter with an optional Cocoa editor. The separate AUv3/mobile adapter uses the reusable native ABI rather than this SDK wrapper.
The separate public AUv2 performance instrument uses
--plugin performance with bounded MusicDevice note input and complete Level
state; Gain remains the default profile and retains its host-bypass policy.
Reusable native AU schema/control/state helpers supply its exact
parameter preflight and CONTROL-owned CF text/state validation.
Build and validate the historical reference¶
CARGO_BUILD_JOBS=2 python3 scripts/bundle-au.py \
--vst3-sdk /path/to/vst3sdk --audio-unit-sdk /path/to/AudioUnitSDK
# Optional embedded editor and actual component Cocoa-view checks:
CARGO_BUILD_JOBS=2 python3 scripts/bundle-au.py \
--vst3-sdk /path/to/vst3sdk --audio-unit-sdk /path/to/AudioUnitSDK --native-editor
The script builds the external Apple static library in Release for the current
macOS architecture with deployment target 12.0, then builds and ad hoc signs the
component under target/vst3/release/AU. It includes SDK and RAVET licence notices.
No normal plug-in directory is modified. The component contains plugin.vst3
as a resource; both binaries must be distributed together. Only macOS arm64
with Xcode 27 and the installed SDKs has been exercised.
The validation executable loads the actual component, registers its factory inside that process, instantiates it through AudioComponent APIs, and checks stereo 48 kHz noninterleaved f32 rendering, gain smoothing, dry bypass, state recall and untouched buffer tails. This requires no audio device or global component registration. VST3 contracts and its official validator also run. This evidence does not establish DAW discovery, auval, other architectures, sandbox execution, callback deadlines or native allocation behavior.
Historical parameter and state semantics¶
The component identity is effect aufx, subtype RvGn, manufacturer Ravt.
Mono and stereo configurations are advertised. Gain ID 1 uses normalized 0..1
AU API values: unity is 0.25, twice amplitude is 0.5; the SDK supplies physical
value display conversion. Rendering uses the shared prepared f32 gain DSP and
its 5 ms smoothing. The underlying VST3 reference defines its bounds.
The host bypass property controls dry output. AUv2 preset recall deliberately preserves the current host bypass: the official wrapper restores processor state, then queues the current bypass value over the stored value. This differs from the complete gain/bypass VST3 and CLAP state contracts. Tests explicitly assert restored gain and preserved host bypass. Consumers needing independent preset bypass must define a separate automatable parameter and contract.
The optional Cocoa editor maps the embedded VST3 IPlugView through the external SDK wrapper, as described below. Hosts may provide their generic parameter UI. Instrument/MIDI ports, f64, auxiliary buses and commercial signing remain pending for this AUv2 path. See decision 0022.
After the shared processor gained native VST3 f64 support, the AUv2 component was rebuilt and its actual-bundle f32 parameter/audio/bypass/state/tail contracts passed again. This validates the existing AU path; the VST3 sample-size declaration does not establish AU f64 negotiation or rendering.
Historical optional Cocoa editor¶
--native-editor embeds the Rust-owned gain/bypass/status WebKit page in the
nested VST3 and validates the component's actual kAudioUnitProperty_CocoaUI
class through AUCocoaUIBase. Default bundling remains DSP-only. The external
SDK owns AU-to-VST3 view/controller and AU parameter gesture notifications; no SDK
source is copied or modified. The shared VST3 editor owns its control
lifecycle and Rust UI codecs, including four input/output meters. The SDK's
prepared output-parameter transfer drains on its main-thread timer and updates
AU parameter storage/listeners and the embedded controller. This provides the
same twelve normalized peak/RMS/diagnostic triples (IDs 10..21) described in
VST3 metering; metadata marks them readable without writable flags.
The wrapper may expose their AU parameter metadata regardless of the VST3 hidden
flag. Levels saturate at four for display; audio/native f64 meter precision is
unchanged. Host bypass can skip processor rendering and retain the previous
meter display. Empty/fault/stopped render paths also retain previous readings.
Timer/run-loop delivery is required, with per-parameter rather than complete-block
UI atomicity. Broader widget/platform/DAW validation remains separate.
Hosts supply the AppKit main thread/run loop and retain the AudioUnit while its
views live. Use AUParameterSet for notifying external UI changes; a raw
AudioUnitSetParameter alone does not notify this listener path. After bulk
preset recall, notify kAUParameterListener_AnyParameter through
AUParameterListenerNotify so listener caches receive current values, including
values needed by subsequent edits. Rendering still uses ordinary AU parameter
queues. Host bypass preservation across preset recall remains unchanged.
The exercised resize path is Cocoa setFrame:, which the SDK maps to IPlugView
onSize; inherited setFrameSize: did not reach that mapping in the probe and
is not claimed. Shared view limits are 360×300 through 1200×900 logical pixels.
Consumers own their host geometry integration and view teardown before disposing
the AudioUnit. The component creates no device or host window automatically.
On macOS 27.0.1 arm64/Xcode 27, an actual loaded component passes three custom
Cocoa view cycles with gain/bypass edits verified in f32 rendered audio,
notifying external host refresh, complete preset recall/refresh, subsequent edits
and setFrame: resizing. Output transfer reaches all four displayed RMS meters;
metadata/normalized values, gain-dependent outputs and injected nonfinite
diagnostics/recovery pass against the actual component. A shown disposable host window produces a readable
native screenshot; a hidden AU host window had returned a flat snapshot despite
working DOM checks. The probe closes its own window afterward. Earlier failures
from non-notifying setters/preset caches and setFrameSize: are retained in work
status. Separate component audio/state/bypass/tail and VST3 validator contracts
also pass. This does not establish DAW discovery, auval, focus/assistive-tech,
sandbox or other-architecture support. See
decision 0078.
Historical optional factory programs¶
Add --factory-programs to enable Unity/Silence/Bypass factory presets from the
embedded VST3 catalogue. It combines with --native-editor; both options default
to disabled. A RAVET-owned AU subclass corrects count-minus-one selector mapping,
queues complete program controls and synchronizes the AU host bypass property.
External SDK sources remain unchanged; only their factory symbol is renamed
in this target. The local factory uses ordinary AUBase effect dispatch, with an
explicit ClassInfoFromDocument restore path; instrument/music/ProcessBufferLists
extensions are not advertised.
Factory preset indices are 0..2. Parameter ID 3 accepts finite normalized 0..1 at block start only, snapping nearest with ties upwards; nonzero sample offsets are rejected. Explicit factory recall updates both gain and host bypass, whereas ordinary saved-state/document recall retains the SDK's host-bypass preservation. Negative custom-preset numbers retain AUBase metadata semantics and do not select a factory sound. Control state remains the persisted record, rather than a stable selected program identity. The custom page still has gain/bypass/status.
Actual component registration and three disposable lifecycles exercise names, repeated/reversed selection, selector endpoints/ties, custom metadata, invalid selection preservation, rendered controls/bypass and document restore. Default build, audio/state/tail and optional editor regressions run separately. This is macOS arm64 in-process reference evidence; DAW preset menus, auval, other architectures, instruments and sample-offset AU program automation remain unvalidated. See decision 0085.
See decision 0100 for the scoped AU meter transfer evidence. It does not establish real-time timer delivery or DAW meter forwarding beyond this owned synthetic host.
Generic instrument evidence — 5 November 2026¶
The Evidence Synth passes actual MusicDevice component
checks for note/CC input, exact delayed click audio and finite tail, MIDI output
bytes/offsets, and latency property notifications, plus auval on macOS arm64.
The product fixture now handles this editor-free instrument. These are synthetic
host checks, with no new Logic Pro instrument evidence.
See the receipt.