Subject: Re: [PD] convolution code error
Date: mer, ago 21, 2002 at 05:49:41 -0700
Quoting J. Scott Hildebrand (jshildebrand@ucdavis.edu):
here is what i'm doing. i've tried numerous things, but
nothing has worked. if i can just get 64 samples into my array and then pull them back out, then i'll be able to do the rest. my previous (wrong) logic made me write this code:
int apple = 0;
t_float lsum = 0.0; t_float rsum = 0.0;
while (n--) { aleftout[apple++] = in1[n]; arightout[apple++] = in2[n]; }
apple = 0; while(set--) { lsum = aleftout[apple++]; rsum = arightout[apple++]; *out1++ = lsum; *out2++ = rsum; }
i still get a seg fault!!!! help me!!! please!!! :)
Here you are increasing apple twice, in both loops. So, for example, instead of
aleftout[apple++] = in1[n]; arightout[apple++] = in2[n];
do
aleftout[apple] = in1[n]; arightout[apple] = in2[n]; apple++;
(change both loops, obviously)
Carlo