diff --git a/plugins/ladspa_effect/calf/calf/osc.h b/plugins/ladspa_effect/calf/calf/osc.h index 36c19fe3c..0d75c575a 100644 --- a/plugins/ladspa_effect/calf/calf/osc.h +++ b/plugins/ladspa_effect/calf/calf/osc.h @@ -111,9 +111,7 @@ struct bandlimiter void make_waveform(float output[SIZE], int cutoff, bool foldover = false) { dsp::fft &fft = get_fft(); - std::vector > new_spec, iffted; - new_spec.resize(SIZE); - iffted.resize(SIZE); + std::complex new_spec[SIZE], iffted[SIZE]; // Copy original harmonics up to cutoff point new_spec[0] = spectrum[0]; for (int i = 1; i < cutoff; i++) @@ -146,7 +144,7 @@ struct bandlimiter new_spec[SIZE - i] = 0.f; } // convert back to time domain (IFFT) and extract only real part - fft.calculate(new_spec.data(), iffted.data(), true); + fft.calculate(new_spec, iffted, true); for (int i = 0; i < SIZE; i++) output[i] = iffted[i].real(); } diff --git a/plugins/ladspa_effect/calf/src/organ.cpp b/plugins/ladspa_effect/calf/src/organ.cpp index 661b73b15..18373c89d 100644 --- a/plugins/ladspa_effect/calf/src/organ.cpp +++ b/plugins/ladspa_effect/calf/src/organ.cpp @@ -171,11 +171,10 @@ static void padsynth(bandlimiter blSrc, bandlimiter tmp; - tmp.resize(ORGAN_BIG_WAVE_SIZE); - blDest.compute_waveform(tmp.data()); - normalize_waveform(tmp.data(), ORGAN_BIG_WAVE_SIZE); - blDest.compute_spectrum(tmp.data()); + float tmp[ORGAN_BIG_WAVE_SIZE]; + blDest.compute_waveform(tmp); + normalize_waveform(tmp, ORGAN_BIG_WAVE_SIZE); + blDest.compute_spectrum(tmp); // limit is 1/2 of the number of harmonics of the original wave result.make_from_spectrum(blDest, foldover, ORGAN_WAVE_SIZE >> (1 + ORGAN_BIG_WAVE_SHIFT));