gen~ error in for-loop I can't explain
Hi Jvkr,
I am not sure, but for some reason when the code is "compiled" it probably thinks it is not used and just removes it.
If you move it to before the s = peek(internbuf, rdix, 0, interp="linear", boundmode="wrap");
it magically recognizes it, as it is used bellow.
I don't think it has something to do with your code, it seemds OK. It is probably a bit of a buggy behaviour from [gen~].
-N
Thank you Nikolas! Updating accumulators at the end of a loop has become such a ingrained habit that I didn't even consider this. I learned something. Btw, in the example I speak of, it is at the end but adds in4 (ix += in4); that works fine.
.j
yeah, the 'in' & 'out' operators are special, like they are set in memory, not just a variable, so the ola example works. the only other way would be to make spd a history, which is not what you want.
it does not help that gen~ threw you it's usual unintelligible and unhelpful errors :-(
i would say it is a gen~ bug and should be reported, as it is such an insane way the language wants you to think.
thanks for the clear example. This is a known bug at the moment, and a rather tricky issue to solve due to how we are code transforming on the GenExpr level.
-Ben
you have to declare values for all variables inside the for loop first, outside the for loop. the compiler does not reliably provide this error message.