Hello, dear Oleg and Till. >From the perspective of a composer/performer who works with live audio, and considering that Faust is intrinsically real-time, would it make sense to have two control primitives, one where computation is skipped when it is not requested, and one where it is computed but not used?
I would find the second case useful as it would always require maximum computation and the control rate could be changed on-the-fly without worrying about clicks, provided that no clicks occurred at audio-rate calculations. Best, Dario On Tue, 14 Jul 2020 at 13:43, Oleg Nesterov <o...@redhat.com> wrote: > 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 >
_______________________________________________ Faudiostream-users mailing list Faudiostream-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/faudiostream-users