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

Level-independent transient detector: the normalized excess of a fast envelope follower over a slow one. More...

#include <envelope.hpp>

Public Member Functions

void prepare (SampleType sample_rate)
void set_fast_ms (SampleType ms)
void set_slow_ms (SampleType ms)
void reset ()
SampleType process (SampleType input)

Static Public Attributes

static constexpr SampleType kDefaultFastMs = SampleType{2}
 Fast enough to sit on the attack itself.
static constexpr SampleType kDefaultSlowMs = SampleType{40}
 Slow enough to represent "the level this material has been running at".

Detailed Description

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

Level-independent transient detector: the normalized excess of a fast envelope follower over a slow one.

out = max(0, (fast - slow) / max(slow, epsilon))

The division is what makes it level-independent: the same musical gesture at -6 dBFS and at -30 dBFS produces the same output, because both followers scale with the input and the ratio does not. An absolute-difference detector needs its threshold re-tuned for every source; this one does not.

RT contract: two BallisticsFilterT instances of scalar state. process() and reset() allocate nothing.

USE: input duckers; adaptive transient shapers; "how hard was that hit" as a modulation source; striking an LpgT from a live input's attacks so an effect breathes with the playing rather than with a fixed clock.

Member Function Documentation

◆ prepare()

template<typename SampleType = float>
void pulp::signal::TransientDetectorT< SampleType >::prepare ( SampleType sample_rate)
inline

◆ process()

template<typename SampleType = float>
SampleType pulp::signal::TransientDetectorT< SampleType >::process ( SampleType input)
inline

◆ reset()

template<typename SampleType = float>
void pulp::signal::TransientDetectorT< SampleType >::reset ( )
inline

◆ set_fast_ms()

template<typename SampleType = float>
void pulp::signal::TransientDetectorT< SampleType >::set_fast_ms ( SampleType ms)
inline

◆ set_slow_ms()

template<typename SampleType = float>
void pulp::signal::TransientDetectorT< SampleType >::set_slow_ms ( SampleType ms)
inline

Member Data Documentation

◆ kDefaultFastMs

template<typename SampleType = float>
SampleType pulp::signal::TransientDetectorT< SampleType >::kDefaultFastMs = SampleType{2}
staticconstexpr

Fast enough to sit on the attack itself.

◆ kDefaultSlowMs

template<typename SampleType = float>
SampleType pulp::signal::TransientDetectorT< SampleType >::kDefaultSlowMs = SampleType{40}
staticconstexpr

Slow enough to represent "the level this material has been running at".


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