Add Stephane and Yann. At least the 2nd problem is obviously a (minor) compiler bug.
On 07/16, Till Bovermann wrote: > > Dear Oleg, James, Dario, all, > > > `control` looks promising, however, it is not as straight-forward as I > thought: Yes. And I think it is still experimental, at least I failed to find any documentation about control/enable. Till, I am not sure I fully understand you questions and I can't use faustide (my browser is too old), but let me try to answer anyway. ------------------------------------------------------------------------------ control(expr, cond) has no effect if faust has to evaluate "expr" anyway. To me this looks strange, and I have no idea if this is by design or not. Let me repeat my previous example: process(inp, cond) = control(sin(inp),cond); 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; } again, sin(input0[i]) is only evaluated if input1[i] != 0. However, process(inp, cond) = control(sin(inp),cond), sin(inp); compiles to virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; for (int i = 0; (i < count); i = (i + 1)) { float fTemp0 = std::sin(float(input0[i])); output0[i] = FAUSTFLOAT(fTemp0); output1[i] = FAUSTFLOAT(fTemp0); } } See? control has no effect. That is why I think that both control(sineFloatFreq) and control(innerSineFloatFreq) in your example should simply output sineFloatFreq. ------------------------------------------------------------------------------ Another problem is that faust doesn't realize that oscp(1000, 0) and oscp(1000.0, 0) is the same thing. This is compiler bug I think, but this is why control(innerSine, _) works "as expected". Minimal example: sig(val) = val / fconstant(float something, "") : (+ : _) ~ _; process = sig(1000), sig(1000.0); Oleg. _______________________________________________ Faudiostream-users mailing list Faudiostream-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/faudiostream-users