v2.4.1 release: scratchpad polish + demo cleanup
Maintenance release, no framework API changes. Scratchpad: Kill All Sound (⌘K) rename, mode-switch desync fix, code-completion prefix filtering restored (⌃Space Show Completions). Demos: GUIDemo voices + CLI EventPattern BlipVoice moved into Synthesizers/, EventPattern demo split into makeLead/makeBass, GUIDemo doc drift fixed (conductor default). LyrebirdScratch gains a SwiftPM package so the workspace shows it like GUIDemo (.xcodeproj kept for distribution). Linux live-coding scratchpad documented.
This commit is contained in:
+22
-6
@@ -1,18 +1,18 @@
|
||||
# Lyrebird — Start Here
|
||||
|
||||
Eight demo projects live in this workspace. This guide covers how to open them, what each one does, where to add your own synthesizers, and the gotchas that will bite you if you don't know about them.
|
||||
Nine demo projects live in this workspace. This guide covers how to open them, what each one does, where to add your own synthesizers, and the gotchas that will bite you if you don't know about them.
|
||||
|
||||
---
|
||||
|
||||
## Opening the Workspace
|
||||
|
||||
Open **`Lyrebird.xcworkspace`** — not any individual `.xcodeproj` file. The workspace links all eight demo projects together so they share the local Lyrebird package.
|
||||
Open **`Lyrebird.xcworkspace`** — not any individual `.xcodeproj` file. The workspace links all nine demo projects together so they share the local Lyrebird package.
|
||||
|
||||
Once open, pick a scheme from the scheme picker at the top of the Xcode window and hit Run.
|
||||
|
||||
---
|
||||
|
||||
## The Eight Demos
|
||||
## The Nine Demos
|
||||
|
||||
### LyrebirdQuickstartDemo — Fastest Sound
|
||||
|
||||
@@ -61,6 +61,17 @@ final class MySynth: SynthesizerBase {
|
||||
|
||||
---
|
||||
|
||||
### LyrebirdGUIDemo — Cross-Platform GUI (macOS + Linux)
|
||||
|
||||
One SwiftPM package whose SwiftUI-style UI builds on **both** macOS (AppKit) and Linux (GTK4 via SwiftOpenUI) from shared source — the same selection drives either front end. Three patches ship, chosen by `LYREBIRD_DEMO`.
|
||||
|
||||
- **Where the synths live:** `Demos/LyrebirdGUIDemo/Sources/LyrebirdGUIDemoKit/Synthesizers/` — `ConductorDemoVoice`, `VectorOscillatorUI`, `SineToneUI`. The views, `DemoSelection`, and the demo controllers sit alongside in `LyrebirdGUIDemoKit/`.
|
||||
- **Patches:** `conductor` (default) — a live `EventConductor` ensemble with engine start/stop and top/bottom part toggles; `vector` — an XY blend pad over four wavetables; `sine` — a frequency/amp/pan tone. Nothing plays until you start it.
|
||||
- **Run it:** `cd Demos/LyrebirdGUIDemo && swift run LyrebirdGUIDemo` (add `LYREBIRD_DEMO=vector` or `=sine` to pick another patch). On Linux needs `libgtk-4-dev` plus `libasound2-dev` + a sound device for audio.
|
||||
- **It's a package, not an `.xcodeproj`:** open the folder (or `Package.swift`) in Xcode, pick the `LyrebirdGUIDemo` scheme, and Run.
|
||||
|
||||
---
|
||||
|
||||
### LyrebirdiOSDemo — iOS App
|
||||
|
||||
A SwiftUI app using `iOSAudioDriver` (RemoteIO). Same `@UIParam` knob system as the macOS demo.
|
||||
@@ -143,7 +154,11 @@ A container app + `.appex` extension target shipping **Realized Sound: LyrebirdF
|
||||
|
||||
### LyrebirdScratch — Live-Coding Scratchpad
|
||||
|
||||
A macOS app that compiles a typed Swift snippet against the live engine at ⌘↩. Backed by `LyrebirdScratchView` and `LiveSession` from the `LyrebirdLiveCompile` SPM target.
|
||||
A macOS app that compiles a typed Swift snippet against the live engine at ⌘↩. Backed by `LyrebirdScratchView` and `LiveSession` from the `LyrebirdLiveCompile` SPM target. (Linux has its own GTK4 host — `swift run LyrebirdScratchLinuxDemo` in `LiveCompile/`; see `LINUX_README.md`.)
|
||||
|
||||
Build it either way, like `LyrebirdGUIDemo`:
|
||||
- **Package** — `Demos/LyrebirdScratch/Package.swift` builds the AppKit host as a plain executable. From that folder: `swift build` then `swift run LyrebirdScratch` (the `swift build` first makes the `…Dynamic` dylibs the snippet link needs). This is how it appears in `Lyrebird.xcworkspace`.
|
||||
- **Xcode project** — the sibling `LyrebirdScratch.xcodeproj` is kept for distribution builds (custom app icon, entitlements, and a run-script that bundles the Lyrebird module artifacts into an exported `.app`).
|
||||
|
||||
**v1 surface:**
|
||||
- Type arbitrary Swift code in the editor pane. The snippet body has `context: SnippetContext` in scope.
|
||||
@@ -154,10 +169,11 @@ A macOS app that compiles a typed Swift snippet against the live engine at ⌘
|
||||
- `context.reportMessage(_:)` — writes a string back to the host status bar.
|
||||
- **⌘↩** — compile and replace. Removes the previous run's anonymous synths (named slots persist), compiles the snippet via `swiftc -emit-library`, `dlopen`s the resulting dylib, calls `lyrebird_snippet_entry`.
|
||||
- **⌘⇧↩** — compile additive. Prior synths stay in the engine.
|
||||
- **Clear Synths** toolbar button — full reset: removes all tracked synths *and* every named slot immediately.
|
||||
- **Kill All Sound** (⌘K, menu) — panic stop / full reset: removes all tracked synths *and* every named slot immediately.
|
||||
- **⌃Space** (Show Completions) / Esc / F5 — manual code completion at the caret (Swift mode).
|
||||
|
||||
**Why this app cannot be sandboxed:**
|
||||
`swiftc` is a subprocess (`posix_spawn`); the output dylib is unsigned. Both are blocked by the macOS App Sandbox. This app is a direct-distribution developer tool only. The entitlements file (`LyrebirdScratch.entitlements`) sets `com.apple.security.cs.disable-library-validation = true` to let Hardened Runtime `dlopen` the unsigned snippet dylib.
|
||||
`swiftc` is a subprocess (`posix_spawn`); the output dylib is unsigned. Both are blocked by the macOS App Sandbox. This app is a direct-distribution developer tool only. In the `.xcodeproj` build the entitlements file (`LyrebirdScratch.entitlements`) sets `com.apple.security.cs.disable-library-validation = true` to let Hardened Runtime `dlopen` the unsigned snippet dylib. The package (`swift run`) build is a bare executable with neither the App Sandbox nor Hardened Runtime, so it needs no entitlement — the shell-out and `dlopen` just work.
|
||||
|
||||
**Dylib lifetime:** loaded dylibs are never unloaded. `Synthesizer` instances reference types from the dylib; unloading while they are active would crash. Every ⌘↩ evaluation writes a new uniquely-named dylib to a per-session temp dir. This is intentional v1 behaviour; a future release may revisit with an XPC worker approach.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user