PSPunch wrote:
Hi,
I am working on a control rate object which outputs a value, only when a variable local to each instance is modified by another thread.
Having not known how to achieve this, the object works fine, but only with a [metro] connected to it, polling for a variable change on each bang.
I've looked into [metro] and [netreceive] which also output values without an external factor (inlet wise), but I kind of got lost in the code.
Is there a simple way of achieving such an effect (i.e. by registering a callback), or does this require a reasonable understanding of the time scheduling mechanism inside Pd?
have a look at the "clock" functionality.
a clock is basically a scheduled callback. if you want it to happen repeatedly (like metro), you have to reschedule the clock within the callback.
apart from that: why don't you just use [metro]? thus nobody has to learn how to start/stop the polling and to set the polling interval; instead they can just use an object which they already know (and if not will find that they should already know :-))
fgmnasdr IOhannes