bugfixes, better MusicXML support and 1.1.0

This commit is contained in:
2026-06-10 08:41:07 -07:00
parent 6d3a0930a1
commit f59fd3b55a
228 changed files with 32271 additions and 2586 deletions
+22 -9
View File
@@ -1,26 +1,26 @@
# Lyrebird — Start Here
Six 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.
Seven 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 six demo projects together so they share the local Lyrebird package.
Open **`Lyrebird.xcworkspace`** — not any individual `.xcodeproj` file. The workspace links all seven 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 Six Demos
## The Seven Demos
### LyrebirdDemo — Real-Time CLI
A command-line tool that plays audio through your default output device using `CoreAudioDriver`.
- **Where to add synthesizers:** `Demos/LyrebirdDemo/LyrebirdDemo/Synthesizers/` — `SineTone.swift` and `DelaySample.swift` are the starting examples
- **Wire it up:** in `main.swift`, call `engine.schedule(MySynth(), after: 0.0)`
- **To stop:** Ctrl-C in the Xcode console, or just let the synthesizer's done action free it
- **Where to add synthesizers:** `Demos/LyrebirdDemo/LyrebirdDemo/Synthesizers/` — `General/SineTone.swift` and `General/DelaySample.swift` are the starting examples (the folder is grouped into `General/`, `Buffer/`, `Granular/`, `Spectral/`)
- **Wire it up:** `main.swift` adds a synth and plays it — `try engine.add(mySynth)`, or `try engine.schedule(mySynth, after: seconds)` for sample-accurate start. (As shipped, `main.swift` runs a demo harness — `BufferDemos(engine: engine).runDemo()`; swap in your own.)
- **To stop:** Ctrl-C in the Xcode console, or give a voice an envelope/line that frees itself (see below)
You can also run this from the terminal: `cd Demos/LyrebirdDemo && swift run`
@@ -36,8 +36,8 @@ A SwiftUI app with a live oscilloscope, parameter knobs, and real-time audio.
```swift
final class MySynth: SynthesizerBase {
@UIParam var freq: LyrebirdFloat = 440.0
@UIParam var amp: LyrebirdFloat = 0.5
@UIParam var freq: Double = 440.0
@UIParam var amp: Double = 0.5
override func build() {
let sig = OscSin.Audio(freq: freq) * amp
@@ -105,6 +105,17 @@ let right = In.Audio(bus: 3) // numOutputChannels + 1
---
### LyrebirdScoreDemo — Score / MusicXML + Offline Render
A command-line tool that builds notated `Score`s with the result-builder DSL, exports them to MusicXML on the Desktop, round-trips them through the parser as a sanity check, then renders the audio to a CAF file via `NRTDriver`.
- **Output files:** `~/Desktop/LyrebirdScoreDemo.musicxml` (a multi-part demo score), `~/Desktop/LyrebirdScoreSections.musicxml` (a sectioned showcase), and `~/Desktop/LyrebirdScoreDemo.caf` (rendered audio). Open the `.musicxml` in Dorico / MuseScore / Finale; open the `.caf` in any DAW.
- **Where the score is built:** `Demos/LyrebirdScoreDemo/LyrebirdScoreDemo/Demos/ScoreDemo.swift` — `makeScore()` (eight parts) and `makeSectionedShowcase()`.
- **Notation coverage:** clefs, keys, dynamics/hairpins, ties, tuplets, grace notes, multi-staff `Staff`/`Voice`, sustain `Pedal`, repeats with 1st/2nd endings, `Section`s + rehearsal marks, glissandi, per-note display overrides, and page layout. Reference: [`Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md`](Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md).
- **Rehearsal-mark tip:** use single-letter `Section` labels (`"A"`, `"B"`, `"C"`) — notation editors auto-sequence rehearsal marks and hide custom words.
---
### LyrebirdAUv3Demo — AUv3 Plugin Reference
A container app + `.appex` extension target shipping **Realized Sound: LyrebirdFM** — a two-operator FM synthesizer wrapped as an `aumu` Audio Unit v3. Loadable in Logic, GarageBand, AUM, Loopy Pro, and any other AUv3 host on macOS.
@@ -152,11 +163,12 @@ final class MySynth: SynthesizerBase {
override func build() {
let sig = OscSin.Audio(freq: 440) * 0.3
output(bus: 0, source: Pan2(input: sig, pan: 0))
doneAction = .freeEnclosing
}
}
```
**Self-freeing voices:** there is no `doneAction` property to set on the synthesizer. Instead, build a `DoneActionWatchable` generator — `EnvelopeGen`, `Line`, `ExponentialLine`, etc. — **inside `build()`** with `doneAction: .freeNode`; it self-registers, and the engine frees the node when that generator finishes. (`DoneAction` cases are `.nothing`, `.freeNode`, `.loop`.)
---
## Common Gotchas
@@ -182,6 +194,7 @@ final class MySynth: SynthesizerBase {
| Synthesizer and node tree | `docs/protocols/synthesizer.md` |
| All built-in generators | `docs/stdlib/generators.md` |
| NRT / offline rendering | `docs/tooling/nrt-guide.md` |
| Score / MusicXML authoring | `Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md` |
| REPL / hot-swap | `docs/tooling/repl.md` |
| Xcode file templates | `docs/tooling/xcode-templates.md` |
| GUI / parameter binding | `docs/ui/gui-system.md` |