Skip to content

feat(akroasis-core): DSP stages 5–7 — compressor, convolution, volume+dither#35

Merged
forkwright merged 2 commits intomainfrom
p1-05/dsp-stages-5-7
Mar 11, 2026
Merged

feat(akroasis-core): DSP stages 5–7 — compressor, convolution, volume+dither#35
forkwright merged 2 commits intomainfrom
p1-05/dsp-stages-5-7

Conversation

@forkwright
Copy link
Owner

Summary

  • Stage 5 — Compressor (dsp/compressor.rs): peak-mode dynamics compressor with exponential attack/release envelope smoothing (RC time constant), hard-knee gain reduction, and brick-wall limiter ceiling. Disabled stage is a zero-cost passthrough. Tier impact: Lossless when enabled.
  • Stage 6 — Convolution (dsp/convolution.rs): Phase 5 passthrough. Signal path metadata wired up (enabled flag, HighQuality tier impact) ready for FFT convolution in Phase 5.
  • Stage 7 — Volume + Dither (dsp/volume.rs): linear gain from level_db, logarithmic slider→gain mapping (40 dB range; slider 50 → −20 dB), TPDF dither via seeded SmallRng for i16/i24/i32 quantization. Public quantize_* free functions for the output stage. new_seeded constructor enables deterministic tests.

Test plan

  • cargo check passes
  • cargo test — 53 tests pass (18 new across the three stages)
  • cargo clippy -- -D warnings clean
  • Compressor: below-threshold passthrough, above-threshold gain reduction, attack ramp at 1 TC ≈ 63.2%, limiter ceiling clamp, disabled passthrough
  • Convolution: passthrough when disabled and when enabled, signal path metadata
  • Volume: unity/zero/half-amplitude gain, slider mapping, quantize full-scale/clamp/f32, TPDF distribution, deterministic seed, no-dither consistency

Depends on: P1-01 (scaffold — merged in #33)
Blocks: P1-07 (gapless), P1-08 (engine)

…+dither

Stage 5 (compressor.rs): peak-mode dynamics compressor with exponential
attack/release envelope smoothing, hard-knee gain reduction, and a
brick-wall limiter ceiling. Disabled stage passes samples through unchanged.

Stage 6 (convolution.rs): Phase 5 passthrough. Samples unmodified;
signal path metadata reports enabled/disabled and HighQuality tier impact
for when FFT convolution is wired up.

Stage 7 (volume.rs): linear gain from level_db, logarithmic slider→gain
mapping (40 dB range, slider 50 → −20 dB), and TPDF dither via SmallRng
for i16/i24/i32 quantization. Public quantize_* free functions for output
stage use. new_seeded constructor enables deterministic testing.

53 tests pass; cargo clippy -D warnings clean.
@forkwright forkwright force-pushed the p1-05/dsp-stages-5-7 branch from f4d9e87 to 19a71b1 Compare March 11, 2026 21:58
@forkwright forkwright merged commit 329fb55 into main Mar 11, 2026
2 checks passed
@forkwright forkwright deleted the p1-05/dsp-stages-5-7 branch March 11, 2026 22:01
This was referenced Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant