# Lyrebird — Installation & Usage How to add Lyrebird to a project and scaffold the five kinds of app it supports: real-time, real-time + UI, non-real-time (offline) render, AUv3 plugin, and iOS. The package is hosted at . --- ## Requirements | Platform | OS | Xcode | Swift | |---|---|---|---| | macOS | 15+ | 16+ | 6.0 | | iOS | 18+ | 16+ | 6.0 | The macOS 15 / iOS 18 floor is hard: Lyrebird's lock-free queues use `Synchronization.Atomic`, which is unavailable earlier. --- ## Adding the package ### Swift Package Manager (`Package.swift`) ```swift // swift-tools-version: 6.0 import PackageDescription let package = Package( name: "MyPiece", platforms: [.macOS(.v15), .iOS(.v18)], dependencies: [ .package(url: "https://realizedsound.mooo.com/josh/Lyrebird", from: "1.0.0"), ], targets: [ .executableTarget( name: "MyPiece", dependencies: [ .product(name: "Lyrebird", package: "Lyrebird"), .product(name: "LyrebirdUI", package: "Lyrebird"), // only if you need the GUI module ]), ] ) ``` The package vends three products: | Product | Kind | Use | |---|---|---| | `Lyrebird` | library (static) | Core framework — Generators, Synthesizers, engine, drivers. | | `LyrebirdUI` | library | SwiftUI parameter controls (`ParameterKnob`, scope/envelope views, `LyrebirdWindow`). | | `LyrebirdCLI` | executable | The `lyrebird` command-line tool (scaffolding, REPL). | ### In Xcode **File ▸ Add Package Dependencies…**, paste the repository URL, choose **Up to Next Major Version** from `1.0.0`, and add the `Lyrebird` (and optionally `LyrebirdUI`) products to your target. ### Local checkout (development) To build against a local clone instead of the remote, use a path dependency: ```swift .package(name: "Lyrebird", path: "/Users/me/Documents/LyrebirdII") ``` The scaffolder (below) does this automatically with `--lyrebird-path`. ### Linkage note The consumer-facing `Lyrebird` product uses **automatic linkage** — SwiftPM/Xcode link it **statically** into your target. No dynamic framework is produced, so adding Lyrebird needs **no special build settings**: no `disable-library-validation` entitlement, no `SWIFT_USE_INTEGRATED_DRIVER` override. It just links. > Internally the package also vends a second product, `LyrebirdDynamic` (`type: .dynamic`), used **only** by the bundled `LiveCompile/` live-coding sub-package — it needs a shared dylib so live-compiled snippets and the host resolve to one copy of every class. You never reference `LyrebirdDynamic` as an external consumer; ignore it. --- ## The `lyrebird` CLI Project scaffolding goes through the `lyrebird` CLI. Install it once onto your `$PATH`: ```bash swift build -c release --product LyrebirdCLI cp .build/release/LyrebirdCLI /usr/local/bin/lyrebird lyrebird --version # verify ``` (From a checkout you can also use `swift run lyrebird …` without installing.) | Command | Purpose | |---|---| | `lyrebird new [--template ] [--lyrebird-path

]` | Scaffold a new project. | | `lyrebird run [--release]` | Build and run the project in the current directory. | | `lyrebird export [--to

] [--overwrite]` | Emit a standalone `SynthesizerBase` template file. | | `lyrebird install-templates [--force]` | Install the Xcode file templates (New File… ▸ Lyrebird). | | `lyrebird uninstall-templates` | Remove them. | | `lyrebird repl` | Swift REPL with `import LyrebirdSynth` available. | | `lyrebird` (no args) | Interactive `lyrebird>` shell. | Full reference: [`docs/tooling/cli-guide.md`](docs/tooling/cli-guide.md). --- ## Generating projects **First sound in 30 seconds** — the `quickstart` template is the shortest path from an installed CLI to audio: ```bash lyrebird new MyFirstSound --template quickstart cd MyFirstSound && lyrebird run # plays a 440 Hz sine for 10 seconds, then exits ``` That's a complete, self-contained Swift Package: a one-oscillator `SineTone`, the engine, and a `main` that starts it, sleeps 10 seconds, and stops. Read it, then reach for the richer templates below. `lyrebird new --template