Peek/poke inside loop structures

Bacchus's icon

Hey,

I've been playing with the new control structures in GenExpr, trying to push their limits a bit. For some reason, I can't read/write to a data or buffer object from within the loop. Is this a bug or a known limitation? I'm hoping that future versions support this, as it'd enable some really useful additions to Gen's current functionality (oversampling, for example). Any insight anyone?

-J

stkr's icon

this is a current limitation. a shame as i agree could be very powerful. i asked the devs about it and it is on the general feature request radar as far as i know.

best.

Graham Wakefield's icon

Yes, unfortunately this is a known issue at the moment, but it will be resolved in the next update. This issue also affects the use of Data etc. within functions currently.

Ernest's icon

HI Graham, I see you answered this post before, I am trying this:

Data somedata(32);
Data moredata(32,32);
y =0;
for (x =0;x
somedata.poke(1);
y += somedata.peek(1);//works...
somedata.poke(1,x);
y += somedata.peek(1,x);//doesn't work.
}
out1 = y;

Now gen supports any number of channels, the latter would be extremely useful for array operations :)

Ernest's icon

Thank you, I will try it in my patch, but there is something causing it not to work. It could be because it is in a subpatch, and it could be because it is in a method, or maybe it is because it is a poly~ object and multiple instances should not write to the same place at the same time, or maybe it is something else. The problem is, when it crashes it deletes everything inside the patch, and after a number of such calamities in projects that also complain if I keep multiple copies of the same file on my searchpath, and with poly~ objects disconnecting themselves when I try to change the file to a version that doesn't work, I kind of decided to stick with what I know works for a while. Maybe I'll have another stab at it when I finish the Godel rewrite, but as Godel is already 1,000 lines of gen~ code that I'm trying to get working, it could be some time before I get to it. Maybe next year? :)