Skip to content

Commit

Permalink
DelayLine: Fix early wrapping in Lagrange interpolation
Browse files Browse the repository at this point in the history
Co-authored-by: LeonPS <leonps531@gmail.com>
  • Loading branch information
szarvas and leonp-s committed Aug 10, 2023
1 parent f0aacca commit 0037e44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/juce_dsp/processors/juce_DelayLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ template <typename SampleType, typename InterpolationType>
void DelayLine<SampleType, InterpolationType>::setMaximumDelayInSamples (int maxDelayInSamples)
{
jassert (maxDelayInSamples >= 0);
totalSize = jmax (4, maxDelayInSamples + 1);
totalSize = jmax (4, maxDelayInSamples + 2);
bufferData.setSize ((int) bufferData.getNumChannels(), totalSize, false, false, true);
reset();
}
Expand Down
2 changes: 1 addition & 1 deletion modules/juce_dsp/processors/juce_DelayLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class DelayLine
For very short delay times, the result of getMaximumDelayInSamples() may
differ from the last value passed to setMaximumDelayInSamples().
*/
int getMaximumDelayInSamples() const noexcept { return totalSize - 1; }
int getMaximumDelayInSamples() const noexcept { return totalSize - 2; }

/** Resets the internal state variables of the processor. */
void reset();
Expand Down

0 comments on commit 0037e44

Please sign in to comment.