Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::GainReduction Class Reference

Canonical gain-reduction meter value. More...

#include <dynamics_contract.hpp>

Public Member Functions

 GainReduction () noexcept=default
double db () const noexcept
 Non-negative attenuation magnitude in decibels.
double signed_db () const noexcept
 The equivalent gain value for addition in the dB domain.
double linear_gain () const noexcept
 The equivalent linear amplitude multiplier in [0, 1]; infinite attenuation maps to zero.

Static Public Member Functions

static GainReduction from_signed_db (double signed_db) noexcept
 Adapt a signed gain value, where attenuation is negative dB.
static GainReduction from_magnitude_db (double magnitude_db) noexcept
 Adapt an attenuation magnitude, where reduction is positive dB.

Detailed Description

Canonical gain-reduction meter value.

db() is always a non-negative magnitude: zero means unity gain and a larger value means more attenuation. This deliberately does not replace legacy gain_reduction_db() accessors whose signs are part of their public contracts. Dynamics processors expose this type through gain_reduction() so meters can consume every lineage without knowing its internal sign.

RT contract: construction and inspection are pure scalar arithmetic over a scalar value. They allocate no memory, lock nothing, and perform no I/O.

Constructor & Destructor Documentation

◆ GainReduction()

pulp::signal::GainReduction::GainReduction ( )
defaultnoexcept

Member Function Documentation

◆ db()

double pulp::signal::GainReduction::db ( ) const
inlinenoexcept

Non-negative attenuation magnitude in decibels.

◆ from_magnitude_db()

GainReduction pulp::signal::GainReduction::from_magnitude_db ( double magnitude_db)
inlinestaticnoexcept

Adapt an attenuation magnitude, where reduction is positive dB.

◆ from_signed_db()

GainReduction pulp::signal::GainReduction::from_signed_db ( double signed_db)
inlinestaticnoexcept

Adapt a signed gain value, where attenuation is negative dB.

◆ linear_gain()

double pulp::signal::GainReduction::linear_gain ( ) const
inlinenoexcept

The equivalent linear amplitude multiplier in [0, 1]; infinite attenuation maps to zero.

◆ signed_db()

double pulp::signal::GainReduction::signed_db ( ) const
inlinenoexcept

The equivalent gain value for addition in the dB domain.


The documentation for this class was generated from the following file: