On 07/14, Till Bovermann wrote:
>
> Thanks also to you, Oleg; is there somewhere an example for the control 
> primitive,

Sorry, I do not know. But see below.

However, I did "git pull" and it seems that "control/enable" are already
supported in FIR scalar mode. Probably the commit 32846af52e92498? Cool.

Say,

        process = control(sin, _);

compiles to

        virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** 
outputs) {
                FAUSTFLOAT* input0 = inputs[0];
                FAUSTFLOAT* input1 = inputs[1];
                FAUSTFLOAT* output0 = outputs[0];
                float fTemp0 = fTempPerm0;
                for (int i = 0; (i < count); i = (i + 1)) {
                        if (float(input1[i]) != 0.0f) {
                                fTemp0 = std::sin(float(input0[i]));
                        }
                        output0[i] = FAUSTFLOAT(fTemp0);
                }
                fTempPerm0 = fTemp0;
        }

note that sin(input0[i]) is only evaluated if input1[i] != 0.

Oleg.



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

Reply via email to