From 6fdaf15f77f10834639635a4b5535b314213e229 Mon Sep 17 00:00:00 2001 From: blancoberg Date: Mon, 26 Aug 2024 18:10:49 +0200 Subject: [PATCH 1/2] initial morph value fix If you modulated the morph value, the initial is never set. instead it interpolates to the initial value from zero, which can cause a glitch in the beginning of each note. --- src/common/dsp/oscillators/WavetableOscillator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/dsp/oscillators/WavetableOscillator.cpp b/src/common/dsp/oscillators/WavetableOscillator.cpp index 742361198d6..9928595d715 100644 --- a/src/common/dsp/oscillators/WavetableOscillator.cpp +++ b/src/common/dsp/oscillators/WavetableOscillator.cpp @@ -84,7 +84,10 @@ void WavetableOscillator::init(float pitch, bool is_display, bool nonzero_init_d // nointerp adjusts the tableid range so that it scans the whole wavetable // rather than wavetable from first to second to last frame nointerp = !oscdata->p[wt_morph].extend_range; - float shape = oscdata->p[wt_morph].val.f; + + float shape = l_shape.v; + //float shape = oscdata->p[wt_morph].val.f; + float intpart; shape *= ((float)oscdata->wt.n_tables - 1.f + nointerp) * 0.99999f; tableipol = modff(shape, &intpart); From a2e7bd2621413d979f1ccb4a6440a01ff52fd24f Mon Sep 17 00:00:00 2001 From: EvilDragon Date: Tue, 27 Aug 2024 00:40:34 +0200 Subject: [PATCH 2/2] Update WavetableOscillator.cpp --- src/common/dsp/oscillators/WavetableOscillator.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/dsp/oscillators/WavetableOscillator.cpp b/src/common/dsp/oscillators/WavetableOscillator.cpp index 9928595d715..9a7b7f3fa0b 100644 --- a/src/common/dsp/oscillators/WavetableOscillator.cpp +++ b/src/common/dsp/oscillators/WavetableOscillator.cpp @@ -86,7 +86,6 @@ void WavetableOscillator::init(float pitch, bool is_display, bool nonzero_init_d nointerp = !oscdata->p[wt_morph].extend_range; float shape = l_shape.v; - //float shape = oscdata->p[wt_morph].val.f; float intpart; shape *= ((float)oscdata->wt.n_tables - 1.f + nointerp) * 0.99999f;