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

## 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

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

- juce_dsp/maths/juce_LogRampedValue.h

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

## Public Member Functions

| LogRampedValue ()=default
| Constructor.
| LogRampedValue (FloatType initialValue) noexcept
| Constructor.
void | setLogParameters (FloatType midPointAmplitudedB, bool rateOfChangeShouldIncrease) noexcept
| Sets the behaviour of the log ramp.
void | reset (double sampleRate, double rampLengthInSeconds) noexcept
| Reset to a new sample rate and ramp length.
void | reset (int numSteps) noexcept
| Set a new ramp length directly in samples.
void | setTargetValue (FloatType newValue) noexcept
| Set a new target value.
FloatType | getNextValue () noexcept
| Compute the next value.
FloatType | skip (int numSamples) noexcept
| Skip the next numSamples samples.
Public Member Functions inherited from juce::SmoothedValueBase< LogRampedValue< FloatType > >
| SmoothedValueBase ()=default
| Constructor.
bool | isSmoothing () const noexcept
| Returns true if the current value is currently being interpolated.
FloatType | getCurrentValue () const noexcept
| Returns the current value of the ramp.
FloatType | getTargetValue () const noexcept
| Returns the target value towards which the smoothed value is currently moving.
void | setCurrentAndTargetValue (FloatType newValue)
| Sets the current value and the target value.
void | applyGain (FloatType *samples, int numSamples) noexcept
| Applies a smoothed gain to a stream of samples S[i] *= gain.

## 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

## Constructors and Destructors

## 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 | ) |

inline noexcept

Constructor.

References juce::SmoothedValueBase< LogRampedValue< FloatType > >::currentValue, and juce::SmoothedValueBase< LogRampedValue< FloatType > >::target.

## Member Functions

## setLogParameters()

template<typename FloatType>

void juce::dsp::LogRampedValue< FloatType >::setLogParameters | ( | FloatType | midPointAmplitudedB,
|  | bool | rateOfChangeShouldIncrease )

inline noexcept

Sets the behaviour of the log ramp.

Parameters

  midPointAmplitudedB | Sets the amplitude of the mid point in decibels, with the target value at 0 dB and the initial value at -inf dB
  rateOfChangeShouldIncrease | If 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

References juce::Decibels::decibelsToGain(), and jassert.

## reset() [1/2]

template<typename FloatType>

void juce::dsp::LogRampedValue< FloatType >::reset | ( | double | sampleRate,
|  | double | rampLengthInSeconds )

inline noexcept

Reset to a new sample rate and ramp length.

Parameters

  sampleRate | The sample rate
  rampLengthInSeconds | The duration of the ramp in seconds

References jassert, and reset().

Referenced by reset().

## reset() [2/2]

template<typename FloatType>

void juce::dsp::LogRampedValue< FloatType >::reset | ( | int | numSteps | ) |

inline noexcept

Set a new ramp length directly in samples.

Parameters

  numSteps | The number of samples over which the ramp should be active

References juce::SmoothedValueBase< LogRampedValue< FloatType > >::setCurrentAndTargetValue(), and juce::SmoothedValueBase< LogRampedValue< FloatType > >::target.

## setTargetValue()

template<typename FloatType>

void juce::dsp::LogRampedValue< FloatType >::setTargetValue | ( | FloatType | newValue | ) |

inline noexcept

Set a new target value.

Parameters

  newValue | The new target value

References juce::approximatelyEqual(), juce::SmoothedValueBase< LogRampedValue< FloatType > >::countdown, juce::SmoothedValueBase< LogRampedValue< FloatType > >::currentValue, juce::SmoothedValueBase< LogRampedValue< FloatType > >::setCurrentAndTargetValue(), and juce::SmoothedValueBase< LogRampedValue< FloatType > >::target.

## getNextValue()

template<typename FloatType>

FloatType juce::dsp::LogRampedValue< FloatType >::getNextValue | ( |  | ) |

inline noexcept

Compute the next value.

Returns
  Smoothed value

References juce::SmoothedValueBase< LogRampedValue< FloatType > >::countdown, juce::SmoothedValueBase< LogRampedValue< FloatType > >::currentValue, juce::SmoothedValueBase< LogRampedValue< FloatType > >::isSmoothing(), juce::jmap(), and juce::SmoothedValueBase< LogRampedValue< FloatType > >::target.

## skip()

template<typename FloatType>

FloatType juce::dsp::LogRampedValue< FloatType >::skip | ( | int | numSamples | ) |

inline noexcept

Skip the next numSamples samples.

This is identical to calling getNextValue numSamples times.

See also
  getNextValue

References juce::SmoothedValueBase< LogRampedValue< FloatType > >::countdown, juce::SmoothedValueBase< LogRampedValue< FloatType > >::currentValue, juce::jmap(), juce::SmoothedValueBase< LogRampedValue< FloatType > >::setCurrentAndTargetValue(), and juce::SmoothedValueBase< LogRampedValue< FloatType > >::target.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited