Examples
Adds a real-time performance example app under Examples/Apple/ (iOS + macOS, SwiftUI). It plays a MIDI file through MidiFileSequencer → Synthesizer → AVAudioEngine and shows a live render-cost meter (% of the real-time audio budget) with a layers stress knob and a file picker — reproducing, standalone, the "debug build gradually glitches/slows/drops out, release is fine" behavior.
Examples/README.md documents the cause and the fix:
- Cause: the unoptimized (
-Onone) DSP in a Debug build is ~50–66× slower than the optimized (-O) Release build and misses the real-time audio deadline. It is not a correctness bug — the per-block render cost is flat over time in both builds. - Fix (develop with the dependency optimized): Xcode optimizes SwiftPM dependencies by build-configuration type, so add a release-type
DevOptimizedconfiguration (name it without "Debug") with your app target forced to-OnoneandDEBUGdefined. Result: SwiftySynth builds-O, your#if DEBUGcode and assertions are preserved, and your own app code stays debuggable. Or simply run the Release configuration. (Do not addunsafeFlagsto the library — it breaks versioned consumers.)
No library changes — the SwiftySynth sources, Package.swift, and tests are byte-identical to 0.1.1. This release only adds the example app and documentation.