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

Pre/post tone shaping around the clipper: a two-pole tilt pair. More...

#include <distortion.hpp>

Public Member Functions

void prepare (double sample_rate)
void set_pre_tone_hz (double hz)
void set_post_tone_hz (double hz)
void set_pre_gain_db (double db)
 Pre-emphasis shelf gain in dB.
void set_tone_mix (double mix01)
 Linear crossfade of the shaped stage against its bypass.
void reset ()
SampleType process_pre (SampleType input)
 The pre-emphasis stage: a high shelf built from the one-pole's complementary outputs, so a gain of 1 is exactly flat by construction rather than to within a fitted tolerance.
SampleType process_post (SampleType input)
 The post stage: a plain one-pole low-pass, the de-fizz.

Static Public Attributes

static constexpr double kPreGainDbMax = 12.0
 Pre-emphasis shelf gain.

Detailed Description

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

Pre/post tone shaping around the clipper: a two-pole tilt pair.

Deliberately NOT a full three-band passive stack — a literal Baxandall/TMB network has its own interacting-pole topology and is its own module. What this is for:

  • pre shapes what the clipper SEES. Rolling lows off before the clip emphasises high-harmonic buzz; rolling highs off keeps the fundamental dominant through the nonlinearity. Standard pre-emphasis practice.
  • post is the de-fizz stage every distortion needs after harmonic generation. For the to-ground topology this is the shunt capacitor's corner made externally controllable; for in-loop the equivalent corner is buried inside the feedback network, so exposing it here gives both topologies the same control.

Both stages are the house TPT one-pole; the filter math is not re-derived.

RT contract: as the clippers. No allocation, no locks.

Member Function Documentation

◆ prepare()

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

◆ process_post()

template<typename SampleType = float>
SampleType pulp::signal::ToneStackT< SampleType >::process_post ( SampleType input)
inline

The post stage: a plain one-pole low-pass, the de-fizz.

◆ process_pre()

template<typename SampleType = float>
SampleType pulp::signal::ToneStackT< SampleType >::process_pre ( SampleType input)
inline

The pre-emphasis stage: a high shelf built from the one-pole's complementary outputs, so a gain of 1 is exactly flat by construction rather than to within a fitted tolerance.

◆ reset()

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

◆ set_post_tone_hz()

template<typename SampleType = float>
void pulp::signal::ToneStackT< SampleType >::set_post_tone_hz ( double hz)
inline

◆ set_pre_gain_db()

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

Pre-emphasis shelf gain in dB.

Positive lifts content above the corner into the clipper, negative keeps the fundamental dominant.

◆ set_pre_tone_hz()

template<typename SampleType = float>
void pulp::signal::ToneStackT< SampleType >::set_pre_tone_hz ( double hz)
inline

◆ set_tone_mix()

template<typename SampleType = float>
void pulp::signal::ToneStackT< SampleType >::set_tone_mix ( double mix01)
inline

Linear crossfade of the shaped stage against its bypass.

Member Data Documentation

◆ kPreGainDbMax

template<typename SampleType = float>
double pulp::signal::ToneStackT< SampleType >::kPreGainDbMax = 12.0
staticconstexpr

Pre-emphasis shelf gain.

Default flat, so the corner alone does the shaping rather than an added gain stage. [design parameter] default 0 dB, range ±12 dB.


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