For AI agents: the complete documentation index is available at ../llms.txt, the full documentation bundle is available at ../llms-full.txt, and this page is available as Markdown at ../docs/audio-engine-flow.md.

Audio engine — full flow (Mermaid)

Diagrams of the iOS piano engine: the audio signal graph (sampler, per-voice filter, inserts, EQ + filter band, sends, mixer, master EQ, limiter), the JS → native control path, and the note scheduling path. Prose and rules: audio-engine.md, module README.

Sources of truth: PianoAudioGraph.swift, FxUnits.swift, SamplerCore.h, native-piano-sampler.ts, native-mixer-sink.ts.

1. Signal flow (AVAudioEngine graph)

Built once in PianoAudioGraph; setters only change parameters, nodes are never re-created or re-connected.

Where the filters live (three different stages, do not confuse them):

FilterWhereScope
Voice low-pass (cutoff, resonance, filter envelope)SamplerCore (setTone)per voice, before any bus
EQ bands 0-2 + FILTER band 3 (setEqBand / setFilter)eq AVAudioUnitEQ, after FxStripwhole piano group, in front of the sends
Reverb return low/high cut, delay high/low cut, master 3-band EQreverbReturnEq, FxDelay, masterEqper bus / master

2. Control flow (JS → native)

3. Note path (gameplay → sound)


Source: docs/audio-engine-flow.md