Timer CHOP

I just want a channel that will count to 5 minutes, then reset to count again. I need this to trigger something every 5 minutes. I see this TimingCHOP, but it has no seconds or minutes but “beats”. Is there any CHOP node I can use as a stopwatch or countdown timer? Thanks!

Hey,
I’m sure there are a few different ways to do this, but here’s one.

Make two Constant CHOPs one with a value of 1 for it’s first channel. The 2nd CHOP should have a value of 1 / $FPS for it’s first channel.

Make a Count CHOP, wire the first Constant CHOP to the Count CHOPs first input. This is the on/off trigger. When this CHOP is 1, the count will increase, when it’s 0 it won’t increase (so you’ll likely want to leave it as 1).
Wire the 2nd Constant CHOP to the 3rd input of the Count CHOP (the increment value input). This input determines how much the count increases each time it cooks. Since you want it to count seconds, increasing by 1 / $FPS every frame will mean it increases by a value of 1 every second. So now this is counting seconds.

Now, on the Count CHOP, go to the Count Page, Set the ‘Off to On’ parameter to ‘None’, and the ‘While On’ parameter to ‘Increase Count’.
You can now control the looping using the Limit feature thats on the same page.

Finally, you can use a Text DAT to monitor the value in the Count CHOP, and execute the script when it loops to zero using the Text DAT’s ‘On to Off’ feature (it’ll execute when the count resets to zero)

Hope that helps

It also seems like you could work the “Clock” chop into the mix if you wanted to.

A script could be triggered every time 5 minutes is reached.

Or again Count and Math chops with Clock input.

Jim

Count CHOP set to 1/300, fed to Speed CHOP (counts to 1 in 300 sec), fed to a Limit CHOP to quantize to step of 1 (yes I know we need easier way to convert to integers). Text DAT set to monitor the Limit CHOP On Value Change, which will run script every 300 sec.

1 Like

Hello- I’m a programmer but new to Touch. What do you mean by use Text Dat to monitor the value in the Chop? Is there python code that is already executing every frame that can do this, or would this need to be hooked up as an expression in some specific parameter? (I have a python function I want to execute every x seconds)

Hello- I’m a programmer but new to Touch. What do you mean by use Text Dat to monitor the value in the Chop? Is there python code that is already executing every frame that can do this, or would this need to be hooked up as an expression in some specific parameter? (I have a python function I want to execute every x seconds)