Hi, list.

There's a problem when using ints in double-precision; particularly, the
internal int representation is always 32-bit, and Stéphane explained that
it can't be changed easily.

So when compiling with -double,

process = _ * 2^32;

resolves to

virtual void compute(int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT**
RESTRICT outputs) {

FAUSTFLOAT* input0 = inputs[0];

FAUSTFLOAT* output0 = outputs[0];

for (int i0 = 0; i0 < count; i0 = i0 + 1) {

output0[i0] = FAUSTFLOAT(0.0);

}

}

because the right operand overflows to 0, whereas

process = _ * 2.0^32;

gives the expected result

virtual void compute(int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT**
RESTRICT outputs) {

FAUSTFLOAT* input0 = inputs[0];

FAUSTFLOAT* output0 = outputs[0];

for (int i0 = 0; i0 < count; i0 = i0 + 1) {

output0[i0] = FAUSTFLOAT(4294967296.0 * double(input0[i0]));

}

}

Since Faust is a high-level language for DSP, wouldn't it make sense to
treat all signals as float unless there's an explicit cast to int?

Ciao,
Dr Dario Sanfilippo
http://dariosanfilippo.com
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to