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

Discoverable name for Pulp's established peak/RMS envelope follower. More...

#include <dynamics_contract.hpp>

Public Types

using Base = BallisticsFilterT<SampleType>
using Mode = typename Base::Mode
enum  TimeConvention

Public Member Functions

 EnvelopeFollowerT ()
void prepare (float sample_rate)
void set_attack_ms (float ms)
void set_release_ms (float ms)
void set_mode (Mode m)
float process (float input)
void process (const float *input, float *output, int num_samples)
float current () const
float current_db (float floor_db=float{-160}) const
 Current envelope in dBFS, floored at floor_db.
float attack_ms () const noexcept
float release_ms () const noexcept
float attack_coefficient () const noexcept
float release_coefficient () const noexcept
void reset ()

Static Public Member Functions

static SampleType coefficient_for_time_ms (SampleType ms, SampleType sample_rate)
static float coefficient_for_time_ms (float ms, float sample_rate)
 Legacy nominal coefficient retained for bit-identical BallisticsFilter output.
static float exact_coefficient_for_time_ms (float ms, float sample_rate)
 Pure coefficient for an exact 10-to-90-percent state-domain interval.

Protected Member Functions

void synchronize_detector_state (float state) noexcept

Friends

template<typename>
class StereoEnvelopeFollowerT

Detailed Description

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

Discoverable name for Pulp's established peak/RMS envelope follower.

Input is a raw signed audio sample in the linear amplitude domain. Peak mode rectifies it; RMS mode squares before smoothing and square-roots the result. Attack and release are exact 10-to-90-percent times in milliseconds in the smoothed-state domain: amplitude for peak mode and mean-square power for RMS mode. BallisticsFilterT remains the legacy-compatible spelling with its historical nominal 2.2 exponent; this type selects the exact ln(9) contract without changing existing BallisticsFilter output.

Member Typedef Documentation

◆ Base

template<typename SampleType = float>
using pulp::signal::EnvelopeFollowerT< SampleType >::Base = BallisticsFilterT<SampleType>

◆ Mode

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

Member Enumeration Documentation

◆ TimeConvention

Constructor & Destructor Documentation

◆ EnvelopeFollowerT()

template<typename SampleType = float>
pulp::signal::EnvelopeFollowerT< SampleType >::EnvelopeFollowerT ( )
inline

Member Function Documentation

◆ attack_coefficient()

float pulp::signal::BallisticsFilterT< float >::attack_coefficient ( ) const
inlinenoexceptinherited

◆ attack_ms()

float pulp::signal::BallisticsFilterT< float >::attack_ms ( ) const
inlinenoexceptinherited

◆ coefficient_for_time_ms() [1/2]

float pulp::signal::BallisticsFilterT< float >::coefficient_for_time_ms ( float ms,
float sample_rate )
inlinestaticinherited

Legacy nominal coefficient retained for bit-identical BallisticsFilter output.

The historical 2.2 exponent approximates, but does not exactly equal, a 10-to-90-percent interval. New code needing the exact contract should use EnvelopeFollowerT from dynamics_contract.hpp.

◆ coefficient_for_time_ms() [2/2]

template<typename SampleType = float>
SampleType pulp::signal::EnvelopeFollowerT< SampleType >::coefficient_for_time_ms ( SampleType ms,
SampleType sample_rate )
inlinestatic

◆ current()

float pulp::signal::BallisticsFilterT< float >::current ( ) const
inlineinherited

◆ current_db()

float pulp::signal::BallisticsFilterT< float >::current_db ( float floor_db = SampleType{-160}) const
inlineinherited

Current envelope in dBFS, floored at floor_db.

A non-finite or positive floor is malformed and uses -160 dBFS. The return value is always finite, including after hostile detector input.

◆ exact_coefficient_for_time_ms()

float pulp::signal::BallisticsFilterT< float >::exact_coefficient_for_time_ms ( float ms,
float sample_rate )
inlinestaticinherited

Pure coefficient for an exact 10-to-90-percent state-domain interval.

◆ prepare()

void pulp::signal::BallisticsFilterT< float >::prepare ( float sample_rate)
inlineinherited

◆ process() [1/2]

void pulp::signal::BallisticsFilterT< float >::process ( const float * input,
float * output,
int num_samples )
inlineinherited

◆ process() [2/2]

float pulp::signal::BallisticsFilterT< float >::process ( float input)
inlineinherited

◆ release_coefficient()

float pulp::signal::BallisticsFilterT< float >::release_coefficient ( ) const
inlinenoexceptinherited

◆ release_ms()

float pulp::signal::BallisticsFilterT< float >::release_ms ( ) const
inlinenoexceptinherited

◆ reset()

void pulp::signal::BallisticsFilterT< float >::reset ( )
inlineinherited

◆ set_attack_ms()

void pulp::signal::BallisticsFilterT< float >::set_attack_ms ( float ms)
inlineinherited

◆ set_mode()

void pulp::signal::BallisticsFilterT< float >::set_mode ( Mode m)
inlineinherited

◆ set_release_ms()

void pulp::signal::BallisticsFilterT< float >::set_release_ms ( float ms)
inlineinherited

◆ synchronize_detector_state()

void pulp::signal::BallisticsFilterT< float >::synchronize_detector_state ( float state)
inlineprotectednoexceptinherited

◆ StereoEnvelopeFollowerT

template<typename SampleType = float>
template<typename>
friend class StereoEnvelopeFollowerT
friend

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