LMMS
Loading...
Searching...
No Matches
juce::dsp::LogRampedValue< FloatType > Class Template Reference

#include <juce_LogRampedValue.h>

Inheritance diagram for juce::dsp::LogRampedValue< FloatType >:
juce::SmoothedValueBase< LogRampedValue< FloatType > >

Public Member Functions

 LogRampedValue ()=default
 LogRampedValue (FloatType initialValue) noexcept
void setLogParameters (FloatType midPointAmplitudedB, bool rateOfChangeShouldIncrease) noexcept
void reset (double sampleRate, double rampLengthInSeconds) noexcept
void reset (int numSteps) noexcept
void setTargetValue (FloatType newValue) noexcept
FloatType getNextValue () noexcept
FloatType skip (int numSamples) noexcept
Public Member Functions inherited from juce::SmoothedValueBase< LogRampedValue< FloatType > >
 SmoothedValueBase ()=default
bool isSmoothing () const noexcept
FloatType getCurrentValue () const noexcept
FloatType getTargetValue () const noexcept
void setCurrentAndTargetValue (FloatType newValue)
void applyGain (FloatType *samples, int numSamples) noexcept

Private Member Functions

void updateRampParameters ()

Private Attributes

bool increasingRateOfChange = true
FloatType B = Decibels::decibelsToGain ((FloatType) -40)
int stepsToTarget = 0
FloatType temp = 0
FloatType source = 0
FloatType r = 0
FloatType d = 1

Additional Inherited Members

Public Types inherited from juce::SmoothedValueBase< LogRampedValue< FloatType > >
using FloatType
Protected Attributes inherited from juce::SmoothedValueBase< LogRampedValue< FloatType > >
FloatType currentValue
FloatType target
int countdown

Detailed Description

template<typename FloatType>
class juce::dsp::LogRampedValue< FloatType >

Utility class for logarithmically smoothed linear values.

Logarithmically smoothed values can be more relevant than linear ones for specific cases such as algorithm change smoothing, using two of them in opposite directions.

The gradient of the logarithmic/exponential slope can be configured by calling LogRampedValue::setLogParameters.

See also
SmoothedValue

@tags{DSP}

Constructor & Destructor Documentation

◆ LogRampedValue() [1/2]

template<typename FloatType>
juce::dsp::LogRampedValue< FloatType >::LogRampedValue ( )
default

Constructor.

◆ LogRampedValue() [2/2]

template<typename FloatType>
juce::dsp::LogRampedValue< FloatType >::LogRampedValue ( FloatType initialValue)
inlinenoexcept

Constructor.

Member Function Documentation

◆ getNextValue()

template<typename FloatType>
FloatType juce::dsp::LogRampedValue< FloatType >::getNextValue ( )
inlinenoexcept

Compute the next value.

Returns
Smoothed value

◆ reset() [1/2]

template<typename FloatType>
void juce::dsp::LogRampedValue< FloatType >::reset ( double sampleRate,
double rampLengthInSeconds )
inlinenoexcept

Reset to a new sample rate and ramp length.

Parameters
sampleRateThe sample rate
rampLengthInSecondsThe duration of the ramp in seconds

◆ reset() [2/2]

template<typename FloatType>
void juce::dsp::LogRampedValue< FloatType >::reset ( int numSteps)
inlinenoexcept

Set a new ramp length directly in samples.

Parameters
numStepsThe number of samples over which the ramp should be active

◆ setLogParameters()

template<typename FloatType>
void juce::dsp::LogRampedValue< FloatType >::setLogParameters ( FloatType midPointAmplitudedB,
bool rateOfChangeShouldIncrease )
inlinenoexcept

Sets the behaviour of the log ramp.

Parameters
midPointAmplitudedBSets the amplitude of the mid point in decibels, with the target value at 0 dB and the initial value at -inf dB
rateOfChangeShouldIncreaseIf true then the ramp starts shallow and gets progressively steeper, if false then the ramp is initially steep and flattens out as you approach the target value

◆ setTargetValue()

template<typename FloatType>
void juce::dsp::LogRampedValue< FloatType >::setTargetValue ( FloatType newValue)
inlinenoexcept

Set a new target value.

Parameters
newValueThe new target value

◆ skip()

template<typename FloatType>
FloatType juce::dsp::LogRampedValue< FloatType >::skip ( int numSamples)
inlinenoexcept

Skip the next numSamples samples.

This is identical to calling getNextValue numSamples times.

See also
getNextValue

◆ updateRampParameters()

template<typename FloatType>
void juce::dsp::LogRampedValue< FloatType >::updateRampParameters ( )
inlineprivate

Member Data Documentation

◆ B

◆ d

template<typename FloatType>
FloatType juce::dsp::LogRampedValue< FloatType >::d = 1
private

◆ increasingRateOfChange

template<typename FloatType>
bool juce::dsp::LogRampedValue< FloatType >::increasingRateOfChange = true
private

◆ r

template<typename FloatType>
FloatType juce::dsp::LogRampedValue< FloatType >::r = 0
private

◆ source

template<typename FloatType>
FloatType juce::dsp::LogRampedValue< FloatType >::source = 0
private

◆ stepsToTarget

template<typename FloatType>
int juce::dsp::LogRampedValue< FloatType >::stepsToTarget = 0
private

◆ temp

template<typename FloatType>
FloatType juce::dsp::LogRampedValue< FloatType >::temp = 0
private

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