From edb4ef67e858e97810cf450c40d8d3ffe4476d7b Mon Sep 17 00:00:00 2001 From: attila Date: Wed, 14 Dec 2022 18:38:52 +0100 Subject: [PATCH] AudioBuffer: Minor correction in documentation --- .../buffers/juce_AudioSampleBuffer.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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