[PD] convolution code error

Carlo E. Prelz fluido at fluido.as
Thu Aug 22 08:09:36 CEST 2002


	Subject: Re: [PD] convolution code error
	Date: mer, ago 21, 2002 at 05:49:41 -0700

Quoting J. Scott Hildebrand (jshildebrand at 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

-- 
  *         Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido at fluido.as             che bisogno ci sarebbe
  *               di parlare tanto di amore e di rettitudine? (Chuang-Tzu)




More information about the Pd-list mailing list