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

#include <gain.hpp>

Public Member Functions

void set_ramp_time (SampleType seconds, SampleType sample_rate)
 Enable a linear per-sample gain ramp.
void set_gain_db (SampleType db)
void set_gain_linear (SampleType linear)
SampleType gain_db () const
SampleType gain_linear () const
SampleType process (SampleType input) const
void process (SampleType *buffer, int num_samples) const
 One channel.
void process (SampleType *const *channels, int num_channels, int num_samples) const
 Every channel of a multi-channel block with one shared ramp: sample i of every channel is multiplied by the same gain, so channels stay matched while the gain moves.

Member Function Documentation

◆ gain_db()

template<typename SampleType = float>
SampleType pulp::signal::GainT< SampleType >::gain_db ( ) const
inline

◆ gain_linear()

template<typename SampleType = float>
SampleType pulp::signal::GainT< SampleType >::gain_linear ( ) const
inline

◆ process() [1/3]

template<typename SampleType = float>
void pulp::signal::GainT< SampleType >::process ( SampleType * buffer,
int num_samples ) const
inline

One channel.

The ramp advances once per sample, so calling this once per channel of a multi-channel buffer moves the ramp once per channel: during a ramp each channel would get a different part of it. Use the multi-channel overload for that.

◆ process() [2/3]

template<typename SampleType = float>
void pulp::signal::GainT< SampleType >::process ( SampleType *const * channels,
int num_channels,
int num_samples ) const
inline

Every channel of a multi-channel block with one shared ramp: sample i of every channel is multiplied by the same gain, so channels stay matched while the gain moves.

Null channel pointers are skipped (the ramp still advances for them).

◆ process() [3/3]

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

◆ set_gain_db()

template<typename SampleType = float>
void pulp::signal::GainT< SampleType >::set_gain_db ( SampleType db)
inline

◆ set_gain_linear()

template<typename SampleType = float>
void pulp::signal::GainT< SampleType >::set_gain_linear ( SampleType linear)
inline

◆ set_ramp_time()

template<typename SampleType = float>
void pulp::signal::GainT< SampleType >::set_ramp_time ( SampleType seconds,
SampleType sample_rate )
inline

Enable a linear per-sample gain ramp.

The default time is one sample, preserving the historical immediate-set behavior.


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