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

y = x * gain + offset, with gain allowed to go negative. More...

#include <mod_tools.hpp>

Public Member Functions

void set_gain (SampleType g)
void set_offset (SampleType o)
SampleType process (SampleType x) const
SampleType gain () const
SampleType offset () const

Static Public Attributes

static constexpr SampleType kMaxGain = SampleType{2}
 Beyond unity in both directions so one routing can also amplify — a 0..1 envelope driving a +/-2 octave pitch sweep is a single slot.

Detailed Description

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

y = x * gain + offset, with gain allowed to go negative.

RT contract: stateless apart from its two settings; everything is audio-thread safe.

USE: this is the depth control for every routing in a patch, and the negative half of its range is the point — inverting an envelope turns a swell into a duck, and inverting an LFO makes a second destination move against the first. offset re-centers: a unipolar envelope becomes bipolar with gain 2, offset -1, and a bipolar LFO becomes unipolar with gain 0.5, offset 0.5.

Member Function Documentation

◆ gain()

template<typename SampleType = float>
SampleType pulp::signal::AttenuverterT< SampleType >::gain ( ) const
inline

◆ offset()

template<typename SampleType = float>
SampleType pulp::signal::AttenuverterT< SampleType >::offset ( ) const
inline

◆ process()

template<typename SampleType = float>
SampleType pulp::signal::AttenuverterT< SampleType >::process ( SampleType x) const
inline

◆ set_gain()

template<typename SampleType = float>
void pulp::signal::AttenuverterT< SampleType >::set_gain ( SampleType g)
inline

◆ set_offset()

template<typename SampleType = float>
void pulp::signal::AttenuverterT< SampleType >::set_offset ( SampleType o)
inline

Member Data Documentation

◆ kMaxGain

template<typename SampleType = float>
SampleType pulp::signal::AttenuverterT< SampleType >::kMaxGain = SampleType{2}
staticconstexpr

Beyond unity in both directions so one routing can also amplify — a 0..1 envelope driving a +/-2 octave pitch sweep is a single slot.


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