OK, this is not unique to select2 ...

Say,
        process = sin(!);

compiles to

        output0[i0] = FAUSTFLOAT(std::sin(float(input1[i0])));

Or,
        process = atan2(1,!);
        
results in

        output0[i0] = FAUSTFLOAT(std::atan2(1.0f, float(input1[i0])));

and please note that

        process = atan2(!,1);

generates the same code

        output0[i0] = FAUSTFLOAT(std::atan2(1.0f, float(input1[i0])));

I feel this has something to do with boxPrimX() logic, but I am not
sure...

Oleg.

On 03/31, Oleg Nesterov wrote:
>
> Hello,
>
> I think I've accidentally run into a problem I can't explain.
>
> Consider this trivial code:
>
>       process = select2(1, 0, !);
>
> I agree, it makes no sense, but faust happily compiles it to
>
>       void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs)
>       {
>               FAUSTFLOAT* input0 = inputs[0];
>               FAUSTFLOAT* input1 = inputs[1];
>               FAUSTFLOAT* output0 = outputs[0];
>               for (int i0 = 0; i0 < count; i0 = i0 + 1) {
>                       output0[i0] = FAUSTFLOAT(float(input1[i0]));
>               }
>       }
>
> and this doesn't look right no matter what. It seems that "!" inside select2
> always has 2 inputs and acts as
>
>       cut(x,y) = y;
>
> I can probably understand this to some extent, "!" should cut an input and
> at the same time select2() should have an output, but to me this code should
> not compile.
>
> Can you explain this?
>
> Oleg.



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

Reply via email to