diff --git a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h index 251a4a04c4..290db9645d 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h +++ b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h @@ -877,7 +877,11 @@ public: @param numSamples the number of samples to process @param startGain the gain to apply to the first sample (this is multiplied with the source samples before they are added to this buffer) - @param endGain the gain to apply to the final sample. The gain is linearly + @param endGain The gain that would apply to the sample after the final sample. + The gain that applies to the final sample is + (numSamples - 1) / numSamples * (endGain - startGain). This + ensures a continuous ramp when supplying the same value in + endGain and startGain in subsequent blocks. The gain is linearly interpolated between the first and last samples. */ void addFromWithRamp (int destChannel, @@ -1043,7 +1047,11 @@ public: @param numSamples the number of samples to process @param startGain the gain to apply to the first sample (this is multiplied with the source samples before they are copied to this buffer) - @param endGain the gain to apply to the final sample. The gain is linearly + @param endGain The gain that would apply to the sample after the final sample. + The gain that applies to the final sample is + (numSamples - 1) / numSamples * (endGain - startGain). This + ensures a continuous ramp when supplying the same value in + endGain and startGain in subsequent blocks. The gain is linearly interpolated between the first and last samples. @see addFrom