FolioDSP
A pure C++ DSP library for Folio Audio's ecosystem of Shakespeare-themed iOS music apps. Zero dependencies beyond the C++ standard library — portable, real-time safe DSP math. Built for fun!
Architecture
FolioDSP is organized into a three-tier component system with a uniform interface contract. Every component implements three interfaces:
- Process — Takes audio in, produces audio out. Runs on the audio thread at sample rate. Real-time safe: no allocations, no locks, no syscalls.
- Snapshot — Emits a typed struct describing internal state at display rate (~30–60 fps). Lock-free triple-buffer transport from audio thread to UI.
- Control — Accepts parameter changes via
setParameter(int, float). StaticParamInfometadata describes dual ranges (full math range + musical default range).
Component Tiers
| Tier | Count | Description |
|---|---|---|
| Primitives | 19 | Mathematical building blocks: oscillators, filters, delay lines, dynamics |
| Color | 13 | Physical system models: tube, tape, vinyl, transformer nonlinearities |
| Algorithms | 6 | Higher-order structures: granular, spectral, Markov, feedback networks |
| Analysis | 2 | Passive feature detectors: pitch tracking, onset detection |
| Core | 5 | Infrastructure: FFT, crossover filters, band splitting, modulation sources |
Design Philosophy: No Artificial Ceilings
No parameter should have an artificial ceiling that prevents interesting behavior. Every parameter defines two ranges:
- Full range (
minValue/maxValue) — the mathematical limits the DSP supports - Default range (
defaultMin/defaultMax) — the "safe" musical range for normal use
The DSP components never clamp to the default range. An oscillator at 0.1 Hz is an LFO; at 440 Hz it's a tone; at 8 kHz it's a whistle. Same component, same math — the transition from "effect" to "synthesis" is a continuum.
Integration
FolioDSP (pure C++)
└── FolioDSPBridge (ObjC++)
└── Touchstone (Swift Package — effect chaining)
└── Ariel (Swift Package — AVAudioEngine)
└── Apps (Prospero, Caliban, Hecate, Puck Suite)