Delay CHOP doesnt reset after restart - sends outputs before inputs

Example setup:
Delay CHOP receives a Pulse, Delay is set to 16 seconds.
I want to be able to stop and restart the project and have the 16 second count start over from when it receives a pulse. I expect the output to ALWAYS occur 16 seconds after receiving a pulse.

Expected behavior:
Delay CHOP receives a Pulse signal, 16 seconds later it spits out a Pulse.
If I stop/restart project playback at any moment, the Delay CHOP should still only output a Pulse 16 seconds after receiving a Pulse.

Observed behavior:
Delay Chop receives a pulse, 4 seconds later i stop and restart project playback, then 12 seconds after restarting the project, Delay spits out a Pulse.
Its as if its retaining the first 4 seconds it already counted down during the first playback.

You can setup a simple test network to see this happening by creating a LFO CHOP set to ramp, give it a slow frequency like 0.0625 (should take 16 seconds to ramp from 0 to 1) feed it to a Count CHOP and to a delay CHOP, and then feed that Delay CHOP into another Count CHOP. Set the delay to a long value like 10 seconds.

The expected behaviour is the the Delay Count should increment 10 seconds after the LFO count increments. But try stopping/restarting the project at intervals below the 10 seconds and you will see that the delay unit is firing at intervals other than 10 seconds after receiving input. Somettimes it will even fire before receiving an input!

Either this is a bug in the Delay CHOP - or i am totally missing something about how to reset the countdown within the Delay CHOP.

Hey @Marshall_Destro

Thanks for the report.

What build are you using ?

Do you have a sample file to share where we could reproduce easily ?

Best,
Michel

Hi JetXS, thanks for the speedy reply.

I am on the 64bit build 2022.32120 please see the attached file.

It cant share the file here because i am a new user and it wont let me post links either :frowning:

Here are the settings:
LFO: Ramp, frequency = 0.5, amplitude 1.1
COUNT: trigger threshold 0.999 (for both count modules)
TRIGGER: trigger threshold 0.999
DELAY: delay = 10 seconds
Timer script has reset pulses on start as shown in pic.

def onStart(timerOp):
	op('lfo1').par.reset.pulse()
	op('count1').par.reset.pulse()
	op('count2').par.reset.pulse()

If you start and stop the project at random intervals you will see the delay unit will keep firing based on what it received during the last playback. Sometimes even firing before it received input.

What do you mean with

If you start and stop the project

Do you stop the project using the timeline, at the bottom of the TouchDesigner window, or do you use the timer CHOP pictured in your post and use the initialize par or the start par ? or the Active toggle ?

Thanks

Edit: You should now be able to share a file.

i use the transport controls at the bottom of the interface, its the only way i know how. I hit the “pause” button, then the rewind button to bring it back to the start, then the play button.

Delay broken example.1.toe (4.8 KB)

Hey @Marshall_Destro,

the most important point might be that pausing the timeline will pause everything - hence the delay still “knows” about the previous trigger and will pass that on x-time after you hit play again. Not a bug.
What’s definitely missing from the Delay CHOP as well as the Trigger CHOP is a Reset Parameter to help them forget.

Not 100% sure what the overarching goal is, but your network might be build with utilizing the Timer CHOP a bit more. With it being tied to the Timeline, instead of setting the “Length Type” parameter to Infinite, switch it to Fixed and set the “Length” parameter to 2 (I picked that value to mimick your LFO settings). Additionally turn on the “Cycle” parameter and turn off the “Cycle Limit” parameter.
Your Timer will still reset when rewinding the timeline but also keep looping over the specified length.
Now on the Output parameter page, enable “Timer Pulse”, “Cycles” and “Cycle Pulse”.
The resulting “timer_pulse” channel can be used to reset the Count CHOPs you are using. The “cycles” channel can be used as your cycle count and the “cycles_pulse” channel can be used for counting the delayed count.

Now the delayed count is a bit tricky but feeding the “cycles_pulse” channel into a Trail CHOP with the “Window Length” parameter set to 10 (your previous delay time) and then trimming to the first sample with a Trim CHOP, this will give you a 10s delayed trigger for the delayed Count CHOP. The Trail CHOP itself is also reset with the “timer_pulse” channel.

Another benefit is that there is no scripting required.

Hope that helps
Cheers
Markus
countingOption.toe (5.0 KB)

2 Likes

Hello @snaut , Thank you so much for your post. It was the solution i needed. I was already suspecting there was a better way to directly interact with the clock of the project and using those extra outputs from the timer module was exactly what i needed.

Here is a link to the final video i make using your input. The timing of the plant video clips moving around the screen was what i needed the timers for.
Astrogliders (original mix) - Marshall Destro - YouTube

thank you again and thank you @JetXS also for your input!!

1 Like