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

Voltage-controlled amplifier. More...

#include <vca.hpp>

Public Types

using Response = VcaResponse

Public Member Functions

void prepare (SampleType sample_rate)
void set_response (Response r)
Response response () const
void set_range_db (double db)
double range_db () const
void set_lag_ms (double ms)
void reset (SampleType control=SampleType{0})
SampleType gain_for (SampleType control) const
 Static response curve, without the lag.
SampleType next_gain (SampleType control)
 Advance the lag by one sample and return the gain that would be applied.
SampleType process (SampleType input, SampleType control)
SampleType control () const
 The lagged control value, for metering or for driving a second stage from the same conditioned control.

Static Public Attributes

static constexpr double kMinRangeDb = 12.0
 Depth of the equal-dB exponential response.
static constexpr double kMaxRangeDb = 120.0
static constexpr double kDefaultRangeDb = 60.0
static constexpr double kDefaultLagMs = 1.0
 Default control lag.

Detailed Description

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

Voltage-controlled amplifier.

The exponential response is g = (e^(k*c) - 1) / (e^k - 1) with k = 4.6, which spans about 40 dB — enough that the bottom of the control range is perceptually silent without the numerical hazards of an actual log curve. Both responses are exactly 0 at control 0 and exactly 1 at control 1; unity at full is a series law, so a VCA left wide open is bit-transparent rather than approximately transparent.

Member Typedef Documentation

◆ Response

template<typename SampleType = float>
using pulp::signal::VcaT< SampleType >::Response = VcaResponse

Member Function Documentation

◆ control()

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

The lagged control value, for metering or for driving a second stage from the same conditioned control.

◆ gain_for()

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

Static response curve, without the lag.

Exposed so a UI can draw the same curve the audio path uses.

◆ next_gain()

template<typename SampleType = float>
SampleType pulp::signal::VcaT< SampleType >::next_gain ( SampleType control)
inline

Advance the lag by one sample and return the gain that would be applied.

◆ prepare()

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

◆ process()

template<typename SampleType = float>
SampleType pulp::signal::VcaT< SampleType >::process ( SampleType input,
SampleType control )
inline

◆ range_db()

template<typename SampleType = float>
double pulp::signal::VcaT< SampleType >::range_db ( ) const
inline

◆ reset()

template<typename SampleType = float>
void pulp::signal::VcaT< SampleType >::reset ( SampleType control = SampleType{0})
inline

◆ response()

template<typename SampleType = float>
Response pulp::signal::VcaT< SampleType >::response ( ) const
inline

◆ set_lag_ms()

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

◆ set_range_db()

template<typename SampleType = float>
void pulp::signal::VcaT< SampleType >::set_range_db ( double db)
inline

◆ set_response()

template<typename SampleType = float>
void pulp::signal::VcaT< SampleType >::set_response ( Response r)
inline

Member Data Documentation

◆ kDefaultLagMs

template<typename SampleType = float>
double pulp::signal::VcaT< SampleType >::kDefaultLagMs = 1.0
staticconstexpr

Default control lag.

Long enough to kill the click from a hard-switched gate, short enough that a percussive envelope keeps its transient.

◆ kDefaultRangeDb

template<typename SampleType = float>
double pulp::signal::VcaT< SampleType >::kDefaultRangeDb = 60.0
staticconstexpr

◆ kMaxRangeDb

template<typename SampleType = float>
double pulp::signal::VcaT< SampleType >::kMaxRangeDb = 120.0
staticconstexpr

◆ kMinRangeDb

template<typename SampleType = float>
double pulp::signal::VcaT< SampleType >::kMinRangeDb = 12.0
staticconstexpr

Depth of the equal-dB exponential response.


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