Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::DiffusionNetworkT< SampleType > Class Template Reference

A bounded cascade of stereo Schroeder allpasses with energy-preserving inter-channel coupling. More...

#include <diffusion_network.hpp>

Classes

struct  StageConfig
struct  Config

Public Member Functions

bool prepare (double sample_rate, double maximum_delay_ms=50.0)
bool configure (const Config &candidate) noexcept
bool prepared () const noexcept
double sample_rate () const noexcept
double maximum_delay_ms () const noexcept
const Config & config () const noexcept
int stage_delay_samples (std::size_t stage, std::size_t channel) const noexcept
std::size_t retained_bytes () const noexcept
int latency_samples () const noexcept
 Earliest non-zero response.
int tail_samples () const noexcept
 -1 denotes the mathematical infinite tail of any recursive allpass.
void reset () noexcept
void process_sample (SampleType input_left, SampleType input_right, SampleType &output_left, SampleType &output_right) noexcept
void process_block (const SampleType *input_left, const SampleType *input_right, SampleType *output_left, SampleType *output_right, std::size_t sample_count) noexcept

Static Public Attributes

static constexpr std::size_t kMaxStages = 8
static constexpr double kMinimumSampleRate = 1000.0
static constexpr double kMaximumSampleRate = 768000.0
static constexpr double kMaximumDelayMs = 100.0
static constexpr double kMinimumNonzeroAllpassGain = 0.02
static constexpr double kMaximumAllpassGain = 0.95
static constexpr double kMinimumNonzeroStereoWidth = 0.02

Detailed Description

template<typename SampleType = float>
class pulp::signal::DiffusionNetworkT< SampleType >

A bounded cascade of stereo Schroeder allpasses with energy-preserving inter-channel coupling.

It smears transients but contains no feedback tank, decay control, damping, modulation, dry path, or reverb policy.

Each scalar allpass is stable for abs(gain) < 1 and has unit magnitude. Each stage then applies an orthonormal stereo rotation. Consequently, the complete network preserves infinite-horizon L2 energy (apart from floating- point roundoff and the shared below-1e-15 tail flush) and cannot create energy through its width control.

prepare() allocates and belongs on the control thread. configure() is a bounded, allocation-free control-thread operation. process_sample(), process_block(), and reset() are bounded, lock-free, and allocation-free. The scalar recurrence is shared with the FDN and CharacterDelay diffusers; this class retains its own contiguous rings because exact one-sample capacity and constant-time logical reset differ from their fractional-delay storage.

Member Function Documentation

◆ config()

template<typename SampleType = float>
const Config & pulp::signal::DiffusionNetworkT< SampleType >::config ( ) const
inlinenoexcept

◆ configure()

template<typename SampleType = float>
bool pulp::signal::DiffusionNetworkT< SampleType >::configure ( const Config & candidate)
inlinenodiscardnoexcept

◆ latency_samples()

template<typename SampleType = float>
int pulp::signal::DiffusionNetworkT< SampleType >::latency_samples ( ) const
inlinenoexcept

Earliest non-zero response.

A non-zero allpass coefficient has direct feed-through; a zero coefficient degenerates to a pure delay.

◆ maximum_delay_ms()

template<typename SampleType = float>
double pulp::signal::DiffusionNetworkT< SampleType >::maximum_delay_ms ( ) const
inlinenoexcept

◆ prepare()

template<typename SampleType = float>
bool pulp::signal::DiffusionNetworkT< SampleType >::prepare ( double sample_rate,
double maximum_delay_ms = 50.0 )
inlinenodiscard

◆ prepared()

template<typename SampleType = float>
bool pulp::signal::DiffusionNetworkT< SampleType >::prepared ( ) const
inlinenoexcept

◆ process_block()

template<typename SampleType = float>
void pulp::signal::DiffusionNetworkT< SampleType >::process_block ( const SampleType * input_left,
const SampleType * input_right,
SampleType * output_left,
SampleType * output_right,
std::size_t sample_count )
inlinenoexcept

◆ process_sample()

template<typename SampleType = float>
void pulp::signal::DiffusionNetworkT< SampleType >::process_sample ( SampleType input_left,
SampleType input_right,
SampleType & output_left,
SampleType & output_right )
inlinenoexcept

◆ reset()

template<typename SampleType = float>
void pulp::signal::DiffusionNetworkT< SampleType >::reset ( )
inlinenoexcept

◆ retained_bytes()

template<typename SampleType = float>
std::size_t pulp::signal::DiffusionNetworkT< SampleType >::retained_bytes ( ) const
inlinenoexcept

◆ sample_rate()

template<typename SampleType = float>
double pulp::signal::DiffusionNetworkT< SampleType >::sample_rate ( ) const
inlinenoexcept

◆ stage_delay_samples()

template<typename SampleType = float>
int pulp::signal::DiffusionNetworkT< SampleType >::stage_delay_samples ( std::size_t stage,
std::size_t channel ) const
inlinenoexcept

◆ tail_samples()

template<typename SampleType = float>
int pulp::signal::DiffusionNetworkT< SampleType >::tail_samples ( ) const
inlinenoexcept

-1 denotes the mathematical infinite tail of any recursive allpass.

A zero-gain cascade is feed-forward and reports a conservative latest impulse-sample bound instead.

Member Data Documentation

◆ kMaximumAllpassGain

template<typename SampleType = float>
double pulp::signal::DiffusionNetworkT< SampleType >::kMaximumAllpassGain = 0.95
staticconstexpr

◆ kMaximumDelayMs

template<typename SampleType = float>
double pulp::signal::DiffusionNetworkT< SampleType >::kMaximumDelayMs = 100.0
staticconstexpr

◆ kMaximumSampleRate

template<typename SampleType = float>
double pulp::signal::DiffusionNetworkT< SampleType >::kMaximumSampleRate = 768000.0
staticconstexpr

◆ kMaxStages

template<typename SampleType = float>
std::size_t pulp::signal::DiffusionNetworkT< SampleType >::kMaxStages = 8
staticconstexpr

◆ kMinimumNonzeroAllpassGain

template<typename SampleType = float>
double pulp::signal::DiffusionNetworkT< SampleType >::kMinimumNonzeroAllpassGain = 0.02
staticconstexpr

◆ kMinimumNonzeroStereoWidth

template<typename SampleType = float>
double pulp::signal::DiffusionNetworkT< SampleType >::kMinimumNonzeroStereoWidth = 0.02
staticconstexpr

◆ kMinimumSampleRate

template<typename SampleType = float>
double pulp::signal::DiffusionNetworkT< SampleType >::kMinimumSampleRate = 1000.0
staticconstexpr

The documentation for this class was generated from the following file: