Definitively is a bug, thanks for reporting, added on the TODO list.

Stéphane 

> Le 13 nov. 2020 à 18:00, Oleg Nesterov <o...@redhat.com> a écrit :
> 
> On 11/13, Karl Schultheisz via Faudiostream-users wrote:
>> 
>>    process = os.osc(55) : rwtable(1024, 0.1, 42, _, 42);
>> 
>> The result, as demonstrated using faustide, is that the hypothesis is wrong.
>> The output signal is a constant 0.1, not a 55Hz sinusoid.
> 
> I think this is a bug. faust wrongly assumes that if ridx is constant then
> the output is constant too.
> 
> Perhaps this is because
> 
>       Tree sigWriteReadTable(Tree n, Tree init, Tree widx, Tree wsig, Tree 
> ridx)
>       {
>           return sigRDTbl(sigWRTbl(gGlobal->nil, sigTable(gGlobal->nil, n, 
> sigGen(init)), widx, wsig), ridx);
>       }
> 
> and the optimization above is valid for sigRDTbl.
> 
> 
> For example,
> 
>       process = rwtable(1024, 0.0, ffunction(int widx(),"",""), _, 0);
> 
> compiles to
> 
>       virtual void instanceConstants(int sample_rate) {
>               fSampleRate = sample_rate;
>               mydspSIG0* sig0 = newmydspSIG0();
>               sig0->instanceInitmydspSIG0(sample_rate);
>               sig0->fillmydspSIG0(1024, ftbl0);
>               fConst0 = ftbl0[0];
>               deletemydspSIG0(sig0);
>       }
>       virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** 
> outputs) {
>               FAUSTFLOAT* input0 = inputs[0];
>               FAUSTFLOAT* output0 = outputs[0];
>               for (int i = 0; (i < count); i = (i + 1)) {
>                       ftbl0[int(widx())] = float(input0[i]);
>                       output0[i] = FAUSTFLOAT(fConst0);
>               }
>       }
> 
> Oleg.
> 



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

Reply via email to