I try to use Faust as an imperative language and signals as arrays. To calculate the shape of my waveform (my array) at time T, I use the previous values (T-1 and T-2).

I must restart from scratch...

Thanks Oleg for your attention !

Sébastien



Le 08/06/2018 à 13:05, Oleg Nesterov a écrit :
On 06/07, Sébastien Clara wrote:
Unfortunately, my code crashes during compilation and I do not know if my
mistake comes from:
may be stack overflow due to infinite recursion,

x = ba.if(gate==1,
        par(i, nbMass, ba.if(i==int(nbMass/2),1,ba.take(i+1,x'))),
        par(i, nbMass,
                // Xi(n) = P1.Xi(n-1) + P2.[Xi-1(n-1) + Xi+1(n-1)] + P3.Xi(n-2) 
+ P4.f
                ba.if(i==0,
                        (p1*ba.take(i+1,[email protected](1/sr))) + 
(p2*(ba.take(nbMass,[email protected](1/sr)) + ba.take(i+2),[email protected](1/sr))) + 
(p3*ba.take(i+1,[email protected](2/sr))) + (p4*f),
                        (p1*ba.take(i+1,[email protected](1/sr))) + 
(p2*(ba.take(i,[email protected](1/sr)) + 
ba.take((i+2)%(nbMass+1)),[email protected](1/sr))) + 
(p3*ba.take(i+1,[email protected](2/sr))) + (p4*f)
                )
        )
);
I have no idea what are you trying to do, but this code looks wrong in any case
or I am totally confused.

        ba.take(i+1,[email protected](1/sr))

looks doubly wrong. ba.take() doesn't make any sense to me, I fail to understand
what it should do. Say,

        process = par(i, 2, ba.take(i+1, 0));

is simply wrong and won't compile.

Also. [email protected](1/sr) refers to the same signal 'x' you are trying to 
define,
this can't work. For example,

        x = x@1;
        process = x;

leads to the endless evaluation cycle, and perhaps this explains the crash.

Oleg.




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to