mirror of
https://codeberg.org/armin/ambivalence.git
synced 2026-09-01 12:20:48 +02:00
26 lines
1.3 KiB
C
26 lines
1.3 KiB
C
|
|
#pragma once
|
||
|
|
#include <array>
|
||
|
|
namespace FDNReverb {
|
||
|
|
// -- Compile-time constants ----------------------------------------------------
|
||
|
|
static constexpr int FDN_N = 8; // FDN order (channels; legacy definition kept for reference)
|
||
|
|
static constexpr int SAPF_STAGES = 3; // allpass stages per delay line
|
||
|
|
static constexpr int ABSO_STAGES = 3; // Stage 1: Jot first-order + LF/HF correction
|
||
|
|
static constexpr int ER_TAPS = 16; // early-reflection FIR taps
|
||
|
|
|
||
|
|
// Stage 2 (Valimaki-Liski cumulative GEQ) stages:
|
||
|
|
// 10: 10-band GEQ (interaction matrix + WLS)
|
||
|
|
//
|
||
|
|
// important design notes:
|
||
|
|
// - the mid-band gain (midGain) of GEQ band 0 is absorbed into the b0/b1/b2 coefficients;
|
||
|
|
// no separate DC gain stage is needed to avoid DC coloration,
|
||
|
|
// just a single gain.
|
||
|
|
// - LF Absorption / HF Damping are applied directly as GEQ target dB,
|
||
|
|
// fully independent of each other.
|
||
|
|
// - targets are clamped to 0 dB or below, mathematically guaranteeing loop gain <= 1.
|
||
|
|
static constexpr int ABSO_STAGES_S2 = 10;
|
||
|
|
|
||
|
|
// Mutually-prime base delays (samples @ 48 kHz), log-distributed 30-130 ms
|
||
|
|
static constexpr std::array<int, FDN_N> BASE_PRIMES_48K = {
|
||
|
|
1451, 1693, 1979, 2311, 2683, 3067, 3491, 3923
|
||
|
|
};
|
||
|
|
} // namespace FDNReverb
|