6.2 KiB
Review-Cycle Backlog
Findings from the 2026-05-10 /lyrebird_review_cycle sweep, plus follow-ons from later cycles. This file lives across phases — addressed bullets get deleted; new review cycles fold their findings in here.
Deferred from 2026-05-27 /lyrebird_review_cycle
-
A-9 — Six early-phase audio-only filters lack namespace-enum wrapper.
CombFilter,AllpassFilter,RingingFilter,ResonatingFilter,SecondOrderSection,FirstOrderSectionare barepublic final class Foo: GeneratorBase, AudioGeneratorat the top level of their files rather than theenum Foo { class Audio: ... }namespace pattern used by all newer audio-only generators (FreeVerb,GVerb,Chorus,Flanger, etc.). All six carry// GeneratorEnum conformance intentionally omittedcomments — consistent with the audio-only contract, but the unwrapped public API means call sites useCombFilter(...)while peers useFreeVerb.Audio(...). Refactoring would be a breaking change touching all call sites; track for a future refactor phase that can land the rename + deprecation alias in one commit. -
Q-4 — Long
_computeSamplesreverb functions.Sources/Lyrebird/Generators/Reverb/PlateReverb.swift:425—_computeSamplesis 224 lines.Sources/Lyrebird/Generators/Reverb/GVerb.swift:324—_computeSamplesis 172 lines.Sources/Lyrebird/Generators/Panning/PanXYDistance.swift:188/PanAzDistance.swift:190— 167 lines each.Sources/Lyrebird/Generators/PhysicalModels/Flute.swift:192— 162 lines. These are RT hot loops where the team has explicitly chosen inlining over decomposition for performance. The reverb pair (Plate + GVerb) might benefit from aRuntimeReverbHelpers.swiftextraction (similar to the existingFilterHelpers.swift/RBJBiquadHelpers.swiftpattern) when profiling justifies a perf pass. The pan + flute cases are cohesive single-purpose state machines and resist splitting.
Architectural drift (kept — not blocking)
_Basepattern vs flatGeneratorBasesubclass split: early generators (CombFilter,AllpassFilter,ResonatingFilter,RingingFilter, allRBJ*types,Pan2/Pan4/PanN,AmbiEncoder1/AmbiDecoder1,DelayLine/DelayLineFeedback,FreqTracker,LookAheadLimiter, all granular generators) hand-allocate_result: [[Double]]and skip theenum { _Base; Audio; Control }pattern. Locking in either direction would break public API. Document in the generator authoring guide as "consider the namespace pattern even for Audio-only generators in case a Control variant becomes useful later," but leave existing public API alone.RBJBiquad.swiftpacks three internal types (BiquadCoeffs,BiquadState,FirstOrderState). All tightly coupled, allinternal. Defensible — low priority split.
Style retained for paper fidelity
- PlateReverb snake_case constants:
Sources/Lyrebird/Generators/Reverb/PlateReverb.swift:77-93uses paper-cross-reference names (plateLTap_LD1_A, etc.). Acceptable for fidelity to the Dattorro paper.
Future-visibility flags (no fix required)
- Long inherently-linear functions:
Sources/Lyrebird/AudioDrivers/CoreAudioDriver.swift:132-301setup(engine:)— ~170 lines, 8 numbered steps. Splitting into_findComponent,_enableIO,_installCallbackwould ease maintenance.Sources/Lyrebird/Process/LyrebirdEventList.swift:949-1052buildFromFile(…)— already commented in 5 numbered steps; readable.Sources/Lyrebird/Generators/Reverb/PlateReverb.swift:325-413Audio.initbuffer-sizing block — straight-line, self-evident.
Skipped — needs LyrebirdBuffer.isEmpty
Sources/Lyrebird/Generators/Reverb/ConvolutionReverb.swift:206usesir.count > 0. Swap to!ir.isEmptywhenLyrebirdBuffergrows that accessor; until thencount > 0is acceptable.
Resolved in step-6 maintenance pass (2026-05-10)
The following findings were addressed in the spectral formant-shift step-6 commit:
- Shared
combFeedbackCoeff/lyrebirdLog60dBLn: extracted intoSources/Lyrebird/Generators/Filters/FilterHelpers.swift.CombFilter,AllpassFilter,ResonatingFilternow call the shared helper / constant. - GeneratorEnum-omitted comment added at end of 20 Audio-only generators (filters, delays, panning, dynamics, granular families).
SecondOrderSection/FirstOrderSection: confirmed user-facing low-level primitives; added init-level/// - Parameters:blocks.- Butterworth queue constant rename: dropped
lyrebirdprefix on internalbutterworthCoeffQueueCapacity/butterworthRespQueueCapacity/butterworthKillQueueCapacity. - LyrebirdUI formatter dedupe: extracted
formattedParameterValue(_:)intoSources/LyrebirdUI/Controls/ParameterFormatting.swiftwith named threshold constants.ParameterKnobandParameterXYroute through it. - Drag-start sentinel collision: replaced the dual-zero check in
ParameterKnob.dragGesturewith an explicit@State var dragInProgress: Boolflag. - Lock without
defer:LyrebirdRoutineContext._checkPausenow useslock(); defer { unlock() }instead of explicit unlocks. .before/.afterarm collapse:LyrebirdProcesscross-EventList validation uses a singlecase .before(let other), .after(let other):switch arm.- Close-error swallowing:
SpectralFrameBufferFileIO.write(to:)now closes the file handle explicitly on the success path so flush failures surface to the caller; thedeferkeeps the close on error bail-out only. ParameterNodeSendable invariant: added one-line comment summarising theAtomic<UInt64>cross-thread channel + RT-only mutable state.
Resolved in steps 1–4 (earlier spectral formant-shift work)
- Foundation import sweep (~54 files), DemandRandom/TemporalStream seed-helper consolidation, DelayInterpolation/MouseTracker file splits, MoogLadder
cutoff:→freq:rename + MuTronIIIpeak:documentation.
Resolved in step 5
docs/stdlib/generators.mdcatalog refresh — covered ~40 missing generator types across 15 categories.
Maintenance discipline
Drain this file periodically. When new review cycles run, fold findings in here instead of dropping them.