Getattr question

The way I use getattr to retrieve the number of samples of a buffer is triggering
the chain every time the buffer size changes - thats good. BUT also on startup of the patch
when nothing has been calculated yet, leading to a lot of error messages. Is there a better
way or an argument to prevent it from tiggering at patch loading time?

image

It’s a bit clunky but you can stick a onebang / gate combo that opens up the first time you run an actual process, and then stays open.

I would just @listen 0 all the time and request when you need the size

1 Like

that is what I usually do too. @weefuzzy might have had a reason not to do so there.

That’s not part of our code base, but it is a pattern we use a lot. But, indeed, @listen 0 is the thing here. Either then switch it to 1 once the patch is initialized, or just use fluid.bufresize, which does all the logic, and gives a bang when resizing is done.

Thank for those hints, @listen 0 works well