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

Stereo upward/downward expander with a continuous bounded gain law. More...

#include <expander.hpp>

Classes

struct  Config

Public Types

using DetectorMode = typename EnvelopeFollowerT<SampleType>::Mode

Public Member Functions

ExpanderStatus prepare (SampleType sample_rate) noexcept
ExpanderStatus configure (const Config &next) noexcept
 Adopt a complete valid configuration.
std::array< SampleType, 2 > process (SampleType left, SampleType right) noexcept
void process (SampleType *left, SampleType *right, int num_samples) noexcept
void set_bypassed (bool bypassed) noexcept
bool bypassed () const noexcept
void reset () noexcept
const Config & config () const noexcept
bool prepared () const noexcept
SampleType sample_rate () const noexcept
int latency_samples () const noexcept
int tail_samples () const noexcept
std::array< SampleType, 2 > current_gain_db () const noexcept
std::array< GainReduction, 2 > gain_reduction () const noexcept

Static Public Member Functions

static SampleType gain_computer_db (SampleType level_db, const Config &config) noexcept
 Pure memoryless curve used by the processor after envelope detection.

Static Public Attributes

static constexpr SampleType kMinThresholdDb = SampleType{-160}
static constexpr SampleType kMaxThresholdDb = SampleType{24}
static constexpr SampleType kMinRatio = SampleType{1}
static constexpr SampleType kMaxRatio = SampleType{20}
static constexpr SampleType kMaxRangeDb = SampleType{96}
static constexpr SampleType kMaxKneeDb = SampleType{48}
static constexpr SampleType kMaxSampleRate = SampleType{1536000}

Detailed Description

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

Stereo upward/downward expander with a continuous bounded gain law.

The prepared peak/RMS follower supplies detector ballistics. prepare() and configure() belong off the audio thread. After preparation, processing, bypass, reset, and inspection allocate no memory, acquire no locks, perform no I/O, and throw no exceptions. Bypass returns the finite input samples exactly while advancing detector state, so leaving bypass has no stale-state discontinuity.

Member Typedef Documentation

◆ DetectorMode

template<typename SampleType = float>
using pulp::signal::ExpanderT< SampleType >::DetectorMode = typename EnvelopeFollowerT<SampleType>::Mode

Member Function Documentation

◆ bypassed()

template<typename SampleType = float>
bool pulp::signal::ExpanderT< SampleType >::bypassed ( ) const
inlinenodiscardnoexcept

◆ config()

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

◆ configure()

template<typename SampleType = float>
ExpanderStatus pulp::signal::ExpanderT< SampleType >::configure ( const Config & next)
inlinenodiscardnoexcept

Adopt a complete valid configuration.

Rejected input leaves both the current configuration and detector history unchanged.

◆ current_gain_db()

template<typename SampleType = float>
std::array< SampleType, 2 > pulp::signal::ExpanderT< SampleType >::current_gain_db ( ) const
inlinenodiscardnoexcept

◆ gain_computer_db()

template<typename SampleType = float>
SampleType pulp::signal::ExpanderT< SampleType >::gain_computer_db ( SampleType level_db,
const Config & config )
inlinestaticnodiscardnoexcept

Pure memoryless curve used by the processor after envelope detection.

◆ gain_reduction()

template<typename SampleType = float>
std::array< GainReduction, 2 > pulp::signal::ExpanderT< SampleType >::gain_reduction ( ) const
inlinenodiscardnoexcept

◆ latency_samples()

template<typename SampleType = float>
int pulp::signal::ExpanderT< SampleType >::latency_samples ( ) const
inlinenodiscardnoexcept

◆ prepare()

template<typename SampleType = float>
ExpanderStatus pulp::signal::ExpanderT< SampleType >::prepare ( SampleType sample_rate)
inlinenodiscardnoexcept

◆ prepared()

template<typename SampleType = float>
bool pulp::signal::ExpanderT< SampleType >::prepared ( ) const
inlinenodiscardnoexcept

◆ process() [1/2]

template<typename SampleType = float>
void pulp::signal::ExpanderT< SampleType >::process ( SampleType * left,
SampleType * right,
int num_samples )
inlinenoexcept

◆ process() [2/2]

template<typename SampleType = float>
std::array< SampleType, 2 > pulp::signal::ExpanderT< SampleType >::process ( SampleType left,
SampleType right )
inlinenoexcept

◆ reset()

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

◆ sample_rate()

template<typename SampleType = float>
SampleType pulp::signal::ExpanderT< SampleType >::sample_rate ( ) const
inlinenodiscardnoexcept

◆ set_bypassed()

template<typename SampleType = float>
void pulp::signal::ExpanderT< SampleType >::set_bypassed ( bool bypassed)
inlinenoexcept

◆ tail_samples()

template<typename SampleType = float>
int pulp::signal::ExpanderT< SampleType >::tail_samples ( ) const
inlinenodiscardnoexcept

Member Data Documentation

◆ kMaxKneeDb

template<typename SampleType = float>
SampleType pulp::signal::ExpanderT< SampleType >::kMaxKneeDb = SampleType{48}
staticconstexpr

◆ kMaxRangeDb

template<typename SampleType = float>
SampleType pulp::signal::ExpanderT< SampleType >::kMaxRangeDb = SampleType{96}
staticconstexpr

◆ kMaxRatio

template<typename SampleType = float>
SampleType pulp::signal::ExpanderT< SampleType >::kMaxRatio = SampleType{20}
staticconstexpr

◆ kMaxSampleRate

template<typename SampleType = float>
SampleType pulp::signal::ExpanderT< SampleType >::kMaxSampleRate = SampleType{1536000}
staticconstexpr

◆ kMaxThresholdDb

template<typename SampleType = float>
SampleType pulp::signal::ExpanderT< SampleType >::kMaxThresholdDb = SampleType{24}
staticconstexpr

◆ kMinRatio

template<typename SampleType = float>
SampleType pulp::signal::ExpanderT< SampleType >::kMinRatio = SampleType{1}
staticconstexpr

◆ kMinThresholdDb

template<typename SampleType = float>
SampleType pulp::signal::ExpanderT< SampleType >::kMinThresholdDb = SampleType{-160}
staticconstexpr

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/signal/include/pulp/signal/expander.hpp