# LyrebirdGUIDemo — one GUI demo, two platforms A live-controllable synth GUI that builds and runs from a single source tree on **macOS** (AppKit + SwiftUI) and **Linux** (GTK4 + SwiftOpenUI). It is the cross-platform counterpart to the richer, macOS-only `LyrebirdMacOSDemo` Xcode project. The split follows the "mostly in a package, thin entry points" shape: | Piece | Where | Platform | |---|---|---| | Synths + views | `Sources/LyrebirdGUIDemoKit/` | shared — one source | | App bootstrap | `Sources/LyrebirdGUIDemo/main.swift` | one `#if` (AppKit vs GTK4) | The view bodies are written to the subset of the View DSL that SwiftUI and SwiftOpenUI share, so there is **one** body per view — not a macOS copy and a Linux copy. Both back ends bind the same core `@UIParam` / `UIParamNode` model, so the controls, the oscilloscope, and the CPU meters are identical. ## Run it ```bash swift run LyrebirdGUIDemo # vector oscillator (default) LYREBIRD_DEMO=sine swift run LyrebirdGUIDemo # stereo sine tone ``` - **macOS** — no extra setup; a native window opens with live audio via Core Audio. - **Linux** — needs `libgtk-4-dev` (GUI) and `libasound2-dev` + a sound device (audio). Without a sound backend the window still opens and the controls work; there is just no sound (`isLiveAudioAvailable` reports it, and the console says so). ## Open in an IDE - **Xcode (macOS)** — open the folder (or `Package.swift`); Xcode treats it as a SwiftPM package. Pick the `LyrebirdGUIDemo` scheme and Run. No `.xcodeproj` to maintain — the package *is* the project. - **VS Code (Linux)** — open the folder with the Swift extension (`swiftlang.swift-vscode`); it picks up `Package.swift`. Run `LyrebirdGUIDemo` from the test/run explorer or a terminal. ## What each demo shows - **vector** — `VectorOscillatorUI`: an XY pad crossfades four corner wavetables (sine / saw-ish / triangle / Hanning); frequency and amplitude knobs; a live oscilloscope and CPU-load strip. - **sine** — `SineToneUI`: a frequency slider, amplitude and pan knobs, a level readout, the scope and CPU strip, and a static envelope plot. Add a synth by dropping a `SynthesizerBase` subclass and a node-based view into `LyrebirdGUIDemoKit`, then extend `DemoSelection` and the `demoContent()` switch in `main.swift`.