Releases: jiyimeta/swiftysynth
Release list
0.1.2
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.
0.1.0
First tagged release of SwiftySynth — a faithful Swift port of the C# MeltySynth SoundFont synthesizer. It loads SF2 SoundFonts and renders MIDI in real time, PCM-validated to be near bit-exact with upstream and with a zero-allocation audio render path.
Highlights
- SoundFont 2.x loading — generators, modulators, stereo sample links, loop modes.
- Synthesis — per-voice volume/modulation envelopes, LFOs, biquad low-pass filter, faithful voice stealing.
- Effects — Freeverb-derived reverb and modulated-delay chorus (bit-exact tunings).
- MIDI — MIDI file parsing plus
MidiFileSequencerwith loop support andseek(to:). - Real-time safe — after warm-up the render path allocates nothing (verified by strict 0/0 malloc-zone witnesses); per-callback p99 well inside the 11.6 ms @ 44.1 kHz / 512-frame deadline.
- Platforms — Swift 6 (swift-tools-version 6.0), macOS 13+ / iOS 16+.
Notes
0.x release — the public API may still change before 1.0. Ported from MeltySynth (MIT License); see NOTICE.