Timer question!

Ok I’m stuck in a logic loop and I need some help. I have a button going into a timer, because I want the button to mock being pushed for one second, it’s working as expected except if I press the button again within that second it resets the timer_fraction that I’m using. To combat this I tried to add an expression between the button and timer that checks if the button is “ready” and only turns on if so. The problem is this creates a cook dependency loop the expression is reading from the timer and vice versa. Is there a way to force the timer to not reset until the second is up? Does this explanation make sense to anyone? :sweat_smile:
ps It is working as expected (once I pull the variables from the timer into selects and reference those), but there is a warning and it’s for a paid show so I want to make sure I’m doing things correctly.

Can you post your toe, or a snippet of it?

Controlling timers with logic based on the timer’s own state is probably best done with execute python callback scripting instead of procedural routing with ops and wires.

Use a panel execute on your button to check the timer’s done or ready state to determine whether or not you can then reset it. There may be other methods for this kind of control built into the timer chop these days, but timer CHOPs also have a ton of python methods for controlling that are really useful.

1 Like

It is possible to avoid the cook loop by using feedback CHOP after Timer. The problem is that it is most likely not optimal. I suppose Python would be better, but I tried a few attempts and I don’t know how to do this :roll_eyes:

Consider using Trigger CHOP if it is not necessary to hold value after the end of the cycle. Set “Attack Length” to value you want and set Peak, Sustain, and Release lengths to 0.

1 Like

The Trigger CHOP! Who knew. Thanks so much, I was stuck on that for way too long. The one other thing I had to set was min trigger length to 1 or else it would add small decimal places if the button was pressed repeatedly. Gotta watch out for those button mashers. Thanks again.

1 Like

It’s a bit messy, but it works.
Here’s an example!
Example.toe (6.0 KB)