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

Vactrol-modelled low-pass gate. More...

#include <lpg.hpp>

Public Member Functions

void prepare (SampleType sample_rate)
void set_decay_ms (double ms)
 Dark-recovery time.
void set_rise_ms (double ms)
void set_colour (SampleType c)
 0 = pure VCA (the filter stays wide open), 1 = pure filter (the gain stays at unity), between = both.
void set_range_hz (SampleType min_hz, SampleType max_hz)
 The effective ceiling is additionally capped at sample_rate / 4 when the cutoff command is applied — see the note in process().
void set_droop (SampleType d)
void strike (SampleType level)
 Ping the cell.
void set_gate (SampleType level)
 Sustained control level, for idiom 4.
void reset ()
SampleType process (SampleType input)
SampleType control () const
 Conditioned cell state, 0..1 — the value both the amplitude and the cutoff are derived from.
SampleType commanded_cutoff_hz () const
 Last cutoff command applied to the owned filter.
SampleType cutoff_hz () const
 Compatibility spelling for the cutoff telemetry.

Static Public Member Functions

static SampleType velocity_to_strike (SampleType velocity)
 Map a 0..1 velocity to a strike level whose loudness and brightness rise together the way a struck object's do.

Static Public Attributes

static constexpr double kRiseMs = 1.5
 Photoresistor light-onset time constant.
static constexpr double kStrikePulseMs = 3.0
 Length of the light pulse a strike() produces, at two rise time constants.
static constexpr SampleType kVcaExponent = SampleType{1.5}
 Control-to-amplitude power law.
static constexpr SampleType kDefaultFcMinHz = SampleType{40}
static constexpr SampleType kDefaultFcMaxHz = SampleType{12000}
static constexpr SampleType kMinFcHz = SampleType{10}
static constexpr SampleType kMaxFcHz = SampleType{20000}
static constexpr double kDefaultDecayMs = 150.0
static constexpr SampleType kDefaultDroop = SampleType{0.5}
 How much the closing slows as the cell darkens.
static constexpr SampleType kMaxDroop = SampleType{0.95}
static constexpr SampleType kVelocityCurve = SampleType{0.7}
 Velocity-to-strike exponent for idiom 2.

Detailed Description

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

Vactrol-modelled low-pass gate.

Member Function Documentation

◆ commanded_cutoff_hz()

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::commanded_cutoff_hz ( ) const
inline

Last cutoff command applied to the owned filter.

The value is useful for metering or visualising the brightness component of the coupled response. Reset, processing, and cutoff-affecting setters keep it synchronized.

◆ control()

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::control ( ) const
inline

Conditioned cell state, 0..1 — the value both the amplitude and the cutoff are derived from.

Useful as a modulation source in its own right.

◆ cutoff_hz()

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::cutoff_hz ( ) const
inline

Compatibility spelling for the cutoff telemetry.

◆ prepare()

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

◆ process()

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

◆ reset()

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

◆ set_colour()

template<typename SampleType = float>
void pulp::signal::LpgT< SampleType >::set_colour ( SampleType c)
inline

0 = pure VCA (the filter stays wide open), 1 = pure filter (the gain stays at unity), between = both.

◆ set_decay_ms()

template<typename SampleType = float>
void pulp::signal::LpgT< SampleType >::set_decay_ms ( double ms)
inline

Dark-recovery time.

50-500 ms is the musical range; the value is the one-pole time constant of the closing, before the droop lengthens it.

◆ set_droop()

template<typename SampleType = float>
void pulp::signal::LpgT< SampleType >::set_droop ( SampleType d)
inline

◆ set_gate()

template<typename SampleType = float>
void pulp::signal::LpgT< SampleType >::set_gate ( SampleType level)
inline

Sustained control level, for idiom 4.

Held until changed; a strike briefly overrides it upward.

◆ set_range_hz()

template<typename SampleType = float>
void pulp::signal::LpgT< SampleType >::set_range_hz ( SampleType min_hz,
SampleType max_hz )
inline

The effective ceiling is additionally capped at sample_rate / 4 when the cutoff command is applied — see the note in process().

◆ set_rise_ms()

template<typename SampleType = float>
void pulp::signal::LpgT< SampleType >::set_rise_ms ( double ms)
inline

◆ strike()

template<typename SampleType = float>
void pulp::signal::LpgT< SampleType >::strike ( SampleType level)
inline

Ping the cell.

The strike accumulates onto whatever charge is left, which is idiom 3.

◆ velocity_to_strike()

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::velocity_to_strike ( SampleType velocity)
inlinestatic

Map a 0..1 velocity to a strike level whose loudness and brightness rise together the way a struck object's do.

Member Data Documentation

◆ kDefaultDecayMs

template<typename SampleType = float>
double pulp::signal::LpgT< SampleType >::kDefaultDecayMs = 150.0
staticconstexpr

◆ kDefaultDroop

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::kDefaultDroop = SampleType{0.5}
staticconstexpr

How much the closing slows as the cell darkens.

0 is a plain exponential; the default gives the lengthening tail that separates a struck object from an RC circuit. Capped below 1 because a droop of 1 would stall the decay at zero instead of reaching it.

◆ kDefaultFcMaxHz

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::kDefaultFcMaxHz = SampleType{12000}
staticconstexpr

◆ kDefaultFcMinHz

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::kDefaultFcMinHz = SampleType{40}
staticconstexpr

◆ kMaxDroop

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::kMaxDroop = SampleType{0.95}
staticconstexpr

◆ kMaxFcHz

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::kMaxFcHz = SampleType{20000}
staticconstexpr

◆ kMinFcHz

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::kMinFcHz = SampleType{10}
staticconstexpr

◆ kRiseMs

template<typename SampleType = float>
double pulp::signal::LpgT< SampleType >::kRiseMs = 1.5
staticconstexpr

Photoresistor light-onset time constant.

◆ kStrikePulseMs

template<typename SampleType = float>
double pulp::signal::LpgT< SampleType >::kStrikePulseMs = 3.0
staticconstexpr

Length of the light pulse a strike() produces, at two rise time constants.

This is the parameter that produces idiom 3: a cold strike reaches about 86% of the strike level, and a strike landing on a decaying cell starts from whatever is left, so successive hits in a roll climb. A pulse much longer than the rise time would saturate the cell and the accumulation would vanish.

◆ kVcaExponent

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::kVcaExponent = SampleType{1.5}
staticconstexpr

Control-to-amplitude power law.

◆ kVelocityCurve

template<typename SampleType = float>
SampleType pulp::signal::LpgT< SampleType >::kVelocityCurve = SampleType{0.7}
staticconstexpr

Velocity-to-strike exponent for idiom 2.


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