diff --git a/src/spessasynth_lib/synthetizer/worklet_system/worklet_utilities/wavetable_oscillator.js b/src/spessasynth_lib/synthetizer/worklet_system/worklet_utilities/wavetable_oscillator.js index de56a0c5..dde3c074 100644 --- a/src/spessasynth_lib/synthetizer/worklet_system/worklet_utilities/wavetable_oscillator.js +++ b/src/spessasynth_lib/synthetizer/worklet_system/worklet_utilities/wavetable_oscillator.js @@ -38,6 +38,11 @@ export function getOscillatorData(voice, sampleData, outputBuffer) } else { + // check and correct end errors + if(voice.sample.end >= sampleData.length) + { + voice.sample.end = sampleData.length - 1; + } for (let i = 0; i < outputBuffer.length; i++) { // linear interpolation