Files
Lyrebird/Sources/Lyrebird/Lyrebird.docc/Targets.md
T

3.6 KiB

Package Targets

@Metadata { @PageKind(article) }

All targets in the Lyrebird Swift Package and when to use each.

Core Targets

LyrebirdC

Thin C shim. Exposes fesetenv(FE_DFL_DISABLE_DENORMS_ENV) to Swift — a C-only macro sentinel that Swift cannot reference directly. Linked into Lyrebird automatically; never import this directly.

Lyrebird

The core framework.

import LyrebirdSynth

Provides: SynthesisEngine, Generator/Synthesizer protocols, all built-in generators, LyrebirdBuffer, ParameterNode, bus system, scheduling, CoreAudioDriver, and NRTDriver. Links CoreAudio, AudioToolbox, and Accelerate.

Built as a .dynamic library (required by an Xcode 26 SPM regression; reverts to .static when fixed).

LyrebirdUI

Optional GUI module.

import LyrebirdUI

Provides: LyrebirdWindow (AppKit/SwiftUI host), @SynthParam property wrapper, and pre-built slider/knob views. Builds under Swift 6 language mode.

Rule: never import LyrebirdUI in Lyrebird — GUI code must stay in this module only.

Executable Targets

LyrebirdCLI — lyrebird command

Project scaffolding, running, and export from the command line.

lyrebird new MyProject
lyrebird run
lyrebird export MySynth
lyrebird repl

Provides an interactive lyrebird> shell with history and tab completion. Builds under Swift 6 language mode.

See doc:CLIGuide for a full walkthrough.

LyrebirdDemo — headless audio starting point

Command-line synthesis without a GUI. Best starting point for a new synthesis program.

swift run LyrebirdDemo

Demonstrates: SynthesizerBase, @LiveParam, OscSin, DelayLine, engine.add/remove, and RT-safe parameter updates. Runs real-time audio via CoreAudioDriver.

Copy this target when you want a headless synthesis starting point. Swap makeDefaultAudioDriver() for NRTDriver(outputURL:duration:) for offline rendering — see doc:NRTGuide.

LyrebirdUIDemo — GUI starting point

AppKit application with SwiftUI parameter controls.

swift run LyrebirdUIDemo

Demonstrates: LyrebirdWindow, @SynthParam-bound slider views, AppDelegate lifecycle, and NoteController pattern.

Copy this target when you want a windowed synthesis app.

LyrebirdBenchmark

Micro-benchmarks for DSP hot paths.

swift run -c release LyrebirdBenchmark

Reports ns/block and ns/sample for scalar vs. vDSP biquad implementations at blockSize = 512. Always run with -c release; debug builds give meaningless numbers.

Test Targets

Target What it covers
LyrebirdTests Core engine: generators, bus system, scheduling, file I/O, all built-in DSP
LyrebirdUITests LyrebirdUI module: parameter binding, @SynthParam, window lifecycle
LyrebirdCLITests LyrebirdCLI: scaffolder, runner, exporter, REPL commands
swift test

Dependency Map

LyrebirdC
└── Lyrebird  (links CoreAudio, AudioToolbox, Accelerate)
    ├── LyrebirdUI  (SwiftUI + AppKit)
    ├── LyrebirdDemo
    ├── LyrebirdBenchmark
    └── LyrebirdUIDemo  (also links LyrebirdUI)

LyrebirdCLI  (links LineNoise)

Choosing a Starting Point

Goal Use
Headless audio synthesis LyrebirdDemo
Windowed app with GUI controls LyrebirdUIDemo
CLI tooling / REPL lyrebird (LyrebirdCLI)
Measure DSP performance LyrebirdBenchmark (release build)
Framework import only import LyrebirdSynth
GUI parameter controls import LyrebirdUI

See Also