juce-MultiStepEnvelopeGenerator icon indicating copy to clipboard operation
juce-MultiStepEnvelopeGenerator copied to clipboard

Incorrect interpolation in FunctionTable

Open KeyCompTheater opened this issue 3 years ago • 1 comments

Hey there,

thanks for providing this great example of a multi stage envelope! I noticed you made a small mistake in your interpolation function, it came up by using small table sizes. The scaled x value to acquire the lower and upper bound read index should be calculated by: float readIndex = phase * (nTableSize - 1); and by this eliminating the upper bound check if (rj >= nTableSize) rj = nTableSize - 1;.

Thanks again!

KeyCompTheater avatar Jun 27 '22 04:06 KeyCompTheater

Well spotted, thank you!

getdunne avatar Jun 27 '22 14:06 getdunne