Browse Source

Tidied up some documentation

tags/2021-05-28
Tom Poole 6 years ago
parent
commit
60d49c2ef0
2 changed files with 25 additions and 7 deletions
  1. +20
    -5
      modules/juce_audio_basics/utilities/juce_SmoothedValue.h
  2. +5
    -2
      modules/juce_dsp/maths/juce_LogRampedValue.h

+ 20
- 5
modules/juce_audio_basics/utilities/juce_SmoothedValue.h View File

@@ -188,17 +188,29 @@ namespace ValueSmoothingTypes
//==============================================================================
/**
A utility class for values that need smoothing, like volume, that should not
change abruptly to avoid audio glitches.
A utility class for values that need smoothing to avoid audio glitches.
To smooth values spread across an exponential range, where the increments
between the current and target value are multiplicative (like frequencies),
you should pass the multiplicative smoothing type as a template parameter:
A ValueSmoothingTypes::Linear template parameter selects linear smoothing,
which increments the SmoothedValue linearly towards its target value.
@code
SmoothedValue<float, ValueSmoothingTypes::Linear> yourSmoothedValue;
@endcode
A ValueSmoothingTypes::Multiplicative template parameter selects
multiplicative smoothing increments towards the target value.
@code
SmoothedValue<float, ValueSmoothingTypes::Multiplicative> yourSmoothedValue;
@endcode
Multiplicative smoothing is useful when you are dealing with
exponential/logarithmic values like volume in dB or frequency in Hz. For
example a 12 step ramp from 440.0 Hz (A4) to 880.0 Hz (A5) will increase the
frequency with an equal temperament tuning across the octave. A 10 step
smoothing from 1.0 (0 dB) to 3.16228 (10 dB) will increase the value in
increments of 1 dB.
Note that when you are using multiplicative smoothing you cannot ever reach a
target value of zero!
@@ -386,6 +398,9 @@ private:
template <typename FloatType>
using LinearSmoothedValue = SmoothedValue <FloatType, ValueSmoothingTypes::Linear>;
//==============================================================================
//==============================================================================
#if JUCE_UNIT_TESTS
template <class SmoothedValueType>


+ 5
- 2
modules/juce_dsp/maths/juce_LogRampedValue.h View File

@@ -31,15 +31,18 @@ namespace dsp
//==============================================================================
/**
Utility class for logarithmically smoothed values.
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 SmoothedValue
@tags{Audio}
@tags{DSP}
*/
template <typename FloatType>
class LogRampedValue : public SmoothedValueBase <LogRampedValue <FloatType>>


Loading…
Cancel
Save