|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
#include <Saturation.h>


Public Member Functions | |
| void | prepare (const AudioSpec &spec) noexcept override |
| Prepares the algorithm with the current audio specification. | |
| void | reset () noexcept override |
| Resets internal states (filters, phase, memory). | |
| Saturation< T >::Algorithm | getType () const noexcept override |
| Identifies the exact algorithm type for CRTP static dispatch. | |
| void | update (T drive, T, const AudioSpec &spec) noexcept override |
| Updates internal coefficients dependent on block-rate parameters. | |
| T | processSample (T sample, T drive, T character, int ch) noexcept |
Public Member Functions inherited from dspark::detail::SaturationAlgorithm< T > | |
| virtual | ~SaturationAlgorithm ()=default |
| void | setAntialias (bool on) noexcept |
| Enables 1st-order antiderivative anti-aliasing (ADAA) on the memoryless curves (Tanh/Tube/HardClip). Combined with oversampling this is the cleanest known approach (Parker/Zavalishin DAFx-16, Bilbao et al. 2017). No-op for algorithms that do not implement it. Default off (transparent). | |
Additional Inherited Members | |
Static Public Attributes inherited from dspark::detail::SaturationAlgorithm< T > | |
| static constexpr int | kAaCh = 16 |
Protected Attributes inherited from dspark::detail::SaturationAlgorithm< T > | |
| std::atomic< bool > | antialias_ { false } |
Definition at line 325 of file Saturation.h.
|
inlineoverridevirtualnoexcept |
Identifies the exact algorithm type for CRTP static dispatch.
Implements dspark::detail::SaturationAlgorithm< T >.
Definition at line 381 of file Saturation.h.
|
inlineoverridevirtualnoexcept |
Prepares the algorithm with the current audio specification.
Implements dspark::detail::SaturationAlgorithm< T >.
Definition at line 365 of file Saturation.h.
|
inlinenoexcept |
Tape under correct AC bias magnetises along the ANHYSTERETIC curve (the bias linearises the loop away) - so the static nonlinearity is M = Ms * L((H + alpha*M)/a), solved per sample by Newton-Raphson from the previous sample's M (warm start: 3 iterations are plenty, and f' = 1 - 3*alpha*L' >= 1 - alpha > 0 has no singularity).
Scaling: Ms = 3a and out = (1-alpha)*M give exactly unit small-signal gain over H = in*drive and a +-1 ceiling, matching the contract of every other algorithm in the pool. The previous formulation stepped M by dM ~ ManDiff*|dH|/(a+|dH|) - a coercivity of ~1.0 in absolute full-scale units, i.e. tape with NO bias: signals below ~0 dBFS*drive fell into a dead zone (measured: -60 dBFS in -> -121 dBFS out, output ~ input^2), wiping out quiet passages and low-level harmonic detail.
Definition at line 419 of file Saturation.h.
|
inlineoverridevirtualnoexcept |
Resets internal states (filters, phase, memory).
Implements dspark::detail::SaturationAlgorithm< T >.
Definition at line 375 of file Saturation.h.
|
inlineoverridevirtualnoexcept |
Updates internal coefficients dependent on block-rate parameters.
Reimplemented from dspark::detail::SaturationAlgorithm< T >.
Definition at line 383 of file Saturation.h.