diff --git a/kn0ck0ut6.cpp b/kn0ck0ut6.cpp index a39f1e9..9a51d41 100644 --- a/kn0ck0ut6.cpp +++ b/kn0ck0ut6.cpp @@ -49,8 +49,7 @@ AKnockout::AKnockout(double rate) : Plugin(p_n_ports) gInFIFO2 = new float [MAX_FRAME_LENGTH]; gFFTworksp2 = (fftwf_complex*)fftwf_malloc(sizeof(fftwf_complex) * MAX_FRAME_LENGTH); gAnaMagn2 = new float [MAX_FRAME_LENGTH]; - gDecay = new float [MAX_FRAME_LENGTH]; - memset(gDecay,0,MAX_FRAME_LENGTH*sizeof(float)); + gDecay = new float [MAX_FRAME_LENGTH]; window = new double [FFTWINDOW]; forward_sp1= fftwf_plan_dft_r2c_1d(FFTWINDOW, FFTRealBuffer , gFFTworksp, @@ -97,6 +96,7 @@ void AKnockout::suspend () memset(gInFIFO2, 0, MAX_FRAME_LENGTH*sizeof(float)); memset(gFFTworksp2, 0, 2*MAX_FRAME_LENGTH*sizeof(float)); memset(gAnaMagn2, 0, MAX_FRAME_LENGTH*sizeof(float)); + memset(gDecay,0,MAX_FRAME_LENGTH*sizeof(float)); } //----------------------------------------------------------------------------------------- @@ -115,6 +115,34 @@ void AKnockout::run(uint32_t sampleFrames) do_rebuild(sampleFrames, FFTWINDOW, iOsamp, sampleRate, p(p_left), p(p_right), p(p_out),1, fDecay, iBlur, loCut, hiCut, centre); } +#define DEFINE_CIRC_COPY(NAME, OUTBUFFER, INBUFFER) \ + static inline int NAME(unsigned int circularsize,\ + float * __restrict flat, float * __restrict circular, unsigned int start,\ + unsigned int length) {\ + int leftover=start+length-circularsize;\ + if(leftover>0) {\ + unsigned int flatindex=0;\ + for(unsigned int circularindex=start; circularindex