slab/menuband: PeakLimiter on master path — no clipping with simultaneous notes
Inserts AVAudioMixerNode → AVAudioUnitEffect (kAudioUnitSubType_PeakLimiter)
between every backend (melodic sampler, drums sampler, MIDISynth) and
mainMixerNode. Chords or stacked sustains across backends now share one
gain stage and get peak-clamped before reaching the output, so the
crackle/clipping at high polyphony is gone.
Limiter tuned for transparency on instrument samples:
attack 2 ms, decay 50 ms, pre-gain 0 dB.
Engine topology:
melodic ─┐
drums ─┼─→ preLimiterMixer ─→ limiter ─→ mainMixerNode ─→ outputNode
midiAU ─┘
Waveform tap stays on mainMixerNode (post-limiter) so the visualizer
shows what the speakers actually emit, including limiter behavior.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>