v2.1.0 release: Swift 6.4 modernization

Typed throws across the closed-error-set APIs (OSC, MIDI, engine add/schedule,
bus/config/parameter, and the WAV/RF64/Spectral file codecs — source-compatible
narrowing, new .ioFailure cases), plus internal hardening: NSLock-guarded
scheduling/MIDI state moved to Mutex<State>, and the Spectral/FFT scratch owners
moved to a ~Copyable RTScratchBuffer RAII buffer. No API or behavioral change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-24 19:54:59 -07:00
parent 2c20b02e59
commit 844dc4d9cd
42 changed files with 835 additions and 640 deletions
+15
View File
@@ -93,6 +93,21 @@ when Lyrebird's MINOR rolls over.
| `func fillRampedResult(into:from:to:mulAdd:graph:count:)` | ControlGenerator ramp helper |
| `func lastGeneratorSampleOrFloat(_:isGenerator:graph:count:)` | block-constant capture from a generator input |
### Scratch buffers (`Buffers/RTScratchBuffer.swift`)
| Symbol | Signature |
|---|---|
| `struct RTScratchBuffer<Element>: ~Copyable` | single-owner heap scratch buffer; compiler-enforced single free at `deinit`, no ARC |
| `RTScratchBuffer.init(count:)` | allocate + zero-fill (`Element: Numeric`) |
| `RTScratchBuffer.init(count:repeating:)` | allocate + fill with a value |
| `RTScratchBuffer.baseAddress` / `.count` / `subscript` | `@inline(__always)`; `baseAddress` for vDSP / Accelerate / `memcpy` interop |
Replaces the hand-paired `UnsafeMutablePointer.allocate` / `deinitialize` /
`deallocate` in a scratch-owning generator. Store as a `let` assigned in `init`
(never a per-call local) so `deinit` frees off the RT thread. Not for
`[UnsafeMutablePointer]` per-channel arrays (a `~Copyable` type cannot be
`Array`-stored) or capacity-1 scalar boxes used via `.pointee` — leave those raw.
### PRNG (`Generators/Noise/WhiteNoise.swift`)
| Symbol | Signature |