Hi Oleg, In audio the classical assumption is that inputs delivered by the audio layer (driver, whatever..) are in the [-1, 1] interval. And the audio outputs have to be also in [-1, 1], otherwise they will be clipped by the audio output layer (driver, whatever..). This assumption is so part of the typing system.
Stéphane > Le 17 nov. 2022 à 21:19, Oleg Nesterov <[email protected]> a écrit : > > global::init() does > > TINPUT = makeSimpleType(kReal, kSamp, kExec, kVect, kNum, interval(-1, > 1)); > > and "interval(-1, 1)" doesn't look right to me. Why does > faust assume that "-1 <= inputs[i] <= 1" ??? > > To me, this code > > process(x,y) = x@(y+1); > > is wrong and should fail with "can't compute the min and max values" > error message, but faust happily compiles it to > > float fVec0[3]; > > ... > > virtual void compute(int count, FAUSTFLOAT** RESTRICT inputs, > FAUSTFLOAT** RESTRICT outputs) { > FAUSTFLOAT* input0 = inputs[0]; > FAUSTFLOAT* input1 = inputs[1]; > FAUSTFLOAT* output0 = outputs[0]; > for (int i0 = 0; i0 < count; i0 = i0 + 1) { > fVec0[0] = float(input0[i0]); > output0[i0] = FAUSTFLOAT(fVec0[int(float(input1[i0]) + > 1.0f)]); > fVec0[2] = fVec0[1]; > fVec0[1] = fVec0[0]; > } > } > > Oleg. > _______________________________________________ Faudiostream-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/faudiostream-devel
