metalhobo
04-10-2010, 08:32 PM
Sorry if these questions seem very newbish. I'm not very good with computers.
So I'm playing with buffer sizes in preparation for doing some noodling around with FFT. Right now I'm just playing around with ProcessDoubleReplacing (I'm sure I'm doing it completely wrong, as always) and getting an input buffer and ouput buffer initialized, but I've run into some issues.
void PlugExample::ProcessDoubleReplacing(double** inputs, double** outputs, int nFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
int fftbuffersize = 512;
WDL_FFT_COMPLEX fftbuffer [fftbuffersize];
for(int i = 0; i < fftbuffersize; i++, in1++){
fftbuffer[i].re = *in1;
}
for(int j = 0; j < fftbuffersize; j++, out1++){
*out1 = fftbuffer[j].re;
}
}
What I've found is with a buffer size of 512 it works like it should. it passes through only the left channel. However, when I set the buffer size to 1024, for some reason it passes both channels, like the plugin isn't even doing anything. At 2048 and higher it just crashes the DAW. I'm pretty sure I'm doing this completely wrong and would appreciate some help.
So I'm playing with buffer sizes in preparation for doing some noodling around with FFT. Right now I'm just playing around with ProcessDoubleReplacing (I'm sure I'm doing it completely wrong, as always) and getting an input buffer and ouput buffer initialized, but I've run into some issues.
void PlugExample::ProcessDoubleReplacing(double** inputs, double** outputs, int nFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
int fftbuffersize = 512;
WDL_FFT_COMPLEX fftbuffer [fftbuffersize];
for(int i = 0; i < fftbuffersize; i++, in1++){
fftbuffer[i].re = *in1;
}
for(int j = 0; j < fftbuffersize; j++, out1++){
*out1 = fftbuffer[j].re;
}
}
What I've found is with a buffer size of 512 it works like it should. it passes through only the left channel. However, when I set the buffer size to 1024, for some reason it passes both channels, like the plugin isn't even doing anything. At 2048 and higher it just crashes the DAW. I'm pretty sure I'm doing this completely wrong and would appreciate some help.