|
JUCE
|
Utility class for linearly smoothed values like volume etc. More...
Public Member Functions | |
| LinearSmoothedValue () noexcept | |
| Constructor. More... | |
| LinearSmoothedValue (FloatType initialValue) noexcept | |
| Constructor. More... | |
| void | reset (double sampleRate, double rampLengthInSeconds) noexcept |
| Reset to a new sample rate and ramp length. More... | |
| void | setValue (FloatType newValue, bool force=false) noexcept |
| Set a new target value. More... | |
| FloatType | getNextValue () noexcept |
| Compute the next value. More... | |
| bool | isSmoothing () const noexcept |
| Returns true if the current value is currently being interpolated. More... | |
| FloatType | getTargetValue () const noexcept |
| Returns the target value towards which the smoothed value is currently moving. More... | |
| void | applyGain (FloatType *samples, int numSamples) noexcept |
| Applies a linear smoothed gain to a stream of samples S[i] *= gain. More... | |
| void | applyGain (FloatType *samplesOut, const FloatType *samplesIn, int numSamples) noexcept |
| Computes output as linear smoothed gain applied to a stream of samples. More... | |
| void | applyGain (AudioBuffer< FloatType > &buffer, int numSamples) noexcept |
| Applies a linear smoothed gain to a buffer. More... | |
Utility class for linearly smoothed values like volume etc.
that should not change abruptly but as a linear ramp, to avoid audio glitches.
|
noexcept |
Constructor.
|
noexcept |
Constructor.
|
noexcept |
Reset to a new sample rate and ramp length.
| sampleRate | The sampling rate |
| rampLengthInSeconds | The duration of the ramp in seconds |
Referenced by dsp::Bias< FloatType >::process(), and dsp::Oscillator< SampleType >::reset().
|
noexcept |
Set a new target value.
| newValue | The new target value |
| force | If true, the value will be set immediately, bypassing the ramp |
Referenced by dsp::LadderFilter< Type >::process(), and dsp::Oscillator< SampleType >::setFrequency().
|
noexcept |
Compute the next value.
Referenced by LinearSmoothedValue< Type >::applyGain(), dsp::Oscillator< SampleType >::process(), and dsp::Oscillator< SampleType >::processSample().
|
noexcept |
Returns true if the current value is currently being interpolated.
Referenced by LinearSmoothedValue< Type >::applyGain(), and dsp::Oscillator< SampleType >::process().
|
noexcept |
Returns the target value towards which the smoothed value is currently moving.
Referenced by dsp::Oscillator< SampleType >::getFrequency().
|
noexcept |
Applies a linear smoothed gain to a stream of samples S[i] *= gain.
| samples | Pointer to a raw array of samples |
| numSamples | Length of array of samples |
|
noexcept |
Computes output as linear smoothed gain applied to a stream of samples.
Sout[i] = Sin[i] * gain
| samplesOut | A pointer to a raw array of output samples |
| samplesIn | A pointer to a raw array of input samples |
| numSamples | The length of the array of samples |
|
noexcept |
Applies a linear smoothed gain to a buffer.
1.8.13