DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
DSParkAu.h File Reference

Native Audio Unit v2 backend: the same plugin class, for Logic Pro. More...

Go to the source code of this file.

Macros

#define DSPARK_PLUGIN_AU_INCLUDED   1
 
#define DSPARK_AU_PLUGIN(PluginClass, subtype4, manufacturer4)
 

Detailed Description

Native Audio Unit v2 backend: the same plugin class, for Logic Pro.

Implements the AUv2 component ABI directly against Apple's AudioToolbox (system headers - nothing to vendor or download). AUv2 remains the format desktop hosts load (Logic Pro, GarageBand, MainStage, Reaper/Live on macOS); AUv3's app-extension model is out of scope for a C++ framework.

#include "plugin/au/DSParkAu.h" // self-disables off-macOS
struct MyPlugin { ... };
DSPARK_AU_PLUGIN(MyPlugin, "Subt", "Manu") // unique 4-char codes
Native Audio Unit v2 backend: the same plugin class, for Logic Pro.
#define DSPARK_AU_PLUGIN(PluginClass, subtype4, manufacturer4)
Definition DSParkAu.h:1767

The bundle side (Info.plist AudioComponents entry pointing at the exported factory, .component folder layout, ad-hoc codesign) is produced by dspark_add_plugin(); auval -v aufx Subt Manu is the release gate and runs in this repository's macOS CI.

Mapping notes:

  • Parameter IDs are the same FNV-1a hashes of the stable text ids used by the VST3/CLAP backends; values travel in PLAIN units (AU convention).
  • The component type follows the class: Category::Instrument is an aumu music device (no input elements; MIDI drives it), a HasMidi effect is an aumf music effect, anything else stays aufx. The bundle's Info.plist entry must declare the same type.
  • MIDI arrives through the MusicDevice selectors as raw bytes, lands in a lock-free ring and is delivered as MidiEvents, time-ordered with the scheduled parameter events (sample-accurate sub-block processing, the same scheme as the VST3/CLAP backends).
  • HasTransport plugins get the host-callback transport (BeatAndTempo / TransportState / MusicalTimeLocation) once per render.
  • Mono and stereo follow the declared ChannelSupport through SupportedNumChannels and the stream format; all elements run the same width. kAudioUnitProperty_OfflineRender feeds setOfflineRendering.
  • State (kAudioUnitProperty_ClassInfo) wraps the shared format-agnostic container in the standard aupreset dictionary, so presets remain portable across all three backends. factoryPresets publish through kAudioUnitProperty_FactoryPresets and PresentPreset; a latency change after parameter motion notifies kAudioUnitProperty_Latency listeners.
  • Host bypass maps to kAudioUnitProperty_BypassEffect with the same crossfade as the other backends.
  • Input arrives by pulling the host's render callback (or connection), the universal aufx pattern auval exercises. render() runs under a DenormalGuard (FTZ/DAZ).
  • Editor: when plugin/webview/DSParkWebViewEditor.h is included before this header and the class declares hasEditor = true, the AU publishes kAudioUnitProperty_CocoaUI - hosts load a runtime-registered view factory from this bundle and get the same WKWebView editor as the VST3/CLAP backends; otherwise they show their generic parameter UI.

Definition in file DSParkAu.h.

Macro Definition Documentation

◆ DSPARK_AU_PLUGIN

#define DSPARK_AU_PLUGIN (   PluginClass,
  subtype4,
  manufacturer4 
)

Definition at line 1767 of file DSParkAu.h.

◆ DSPARK_PLUGIN_AU_INCLUDED

#define DSPARK_PLUGIN_AU_INCLUDED   1

Definition at line 59 of file DSParkAu.h.