On 02/27, Oleg Nesterov wrote:
>
> On 02/27, Hermann Meyer wrote:
> >
> > I always implement the bypass switch in C/C++.
>
> and I guess this makes sense, but
>
> > When using select2 in
> > faust, always both path been processed. That means, even when you switch
> > into bypass, the CPU load will stay the same.
>
> Not really, only with -sts / --strict-select option.

Forgot to mention... Of course, if Then or Else branch has state, say,

        process = select2(_, 0, (+(1)~_));

then both paths will be processed.

> For example,
>
>       process = select2(_,
>               ffunction(float func0(), "",""),
>               ffunction(float func1(), "",""));
>
> compiles to
>
>       for (int i0 = 0; i0 < count; i0 = i0 + 1) {
>               output0[i0] = FAUSTFLOAT(((int(float(input0[i0]))) ? func1() : 
> func0()));
>       }
>
> while "faust -sts" generates the "strict" code:
>
>       for (int i0 = 0; i0 < count; i0 = i0 + 1) {
>               float fThen0 = func0();
>               float fElse0 = func1();
>               output0[i0] = FAUSTFLOAT(((int(float(input0[i0]))) ? fElse0 : 
> fThen0));
>       }
>
> Oleg.



_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to