I guess I was not clear, I am not using it as a loop, I was just saying that at the code level [trigger] is a for loop, so having it break would be simple to add. I am using it more as a conditional, if certain conditions are met on this output, it bangs the right inlet and stops the rest. This is easy enough to manage other ways most of the time, but it can get ugly. I will attempt to simplify my current use after work and send it on if this has not resolved by then, so far my attempts to simplify it have not been successful and the patch itself needs to be cleaned up before subjecting anyone to it, which I am currently working on doing.
On Wed, Mar 17, 2021 at 12:18 PM IOhannes m zmoelnig <
zmoelnig@iem.at> wrote:
On 3/17/21 9:39 AM, adam johnson wrote:
> Sometimes when using trigger I find myself needing to break out of it
> before it completes, simple to work up an abstraction to handle this,
> but it got me to wondering why trigger does not have a right inlet to
> stop the sequence. Looking at the code, trigger is a for loop as
> expected, so it would seem to be a very simple task to add this right
> inlet to allow breaking out of the sequence, is there a reason trigger
> lacks this? Something so simple and obvious never having been done
> suggests I am missing something, is this not as useful as it seems? Am
> I missing something about dataflow?
i think so.
[trigger] is not a loop¹.
it's a device to guarantee order-of-execution.
there are other devices to stop dataflow (e.g. [spigot]), and devices to
create stoppable loops ([until]), if that is really what you need.
it's hard to say so without an actual example.
fgdmst
IOhannes
¹ as you figured by looking at the code, it is implemented (in C) using
a for-loop. but that doesn't make it a loop. if you look deeper, you
might find the for-loop translates to CMP and JMP instructions. that
doesn't make [trigger] much of a comparator or a a jumper.
_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list