Looping for set time amount

Sep 20, 2013 at 5:03pm

Looping for set time amount

This may have been answered (I’m brand new to this program). Is there a way to run a loop for a set amount of time so the loop turns itself off? I am setting up a sound installation that needs to run for 30 minutes based on a single sound. I may not be able to be there to turn it off and want a way for the loop to shut itself off so the people running the installation wont have to do it themselves.

#265842
Sep 20, 2013 at 9:36pm

There is probably a better way, but this works.

<code>

– Pasted Max Patch, click to expand. –

</code>

#265847
Sep 21, 2013 at 12:20pm

That worked great. Thank you very much!

#265877
Sep 21, 2013 at 1:12pm

The principle you want to be aware of is scheduling an event to happen at some time in the future. That’s what Max excels at. Mike’s solution continually schedules events 1 second in the future, counts them, and reports when 1800 of them have occurred. But that means lots of scheduling and testing, and you know that 1799 of the tests will have a negative result. If you know in advance the point in time when you want something to happen, you can simply schedule that one event. The delay object is fine for that (or the timepoint object if you’re working in transport-based time).
<code>

– Pasted Max Patch, click to expand. –

</code>

#265879
Sep 21, 2013 at 5:58pm

I knew there was a better way! Thanks Christopher for helping me think from the “schedular’s” perspective.

Your welcome ShawnT, hope the installation goes swimmingly.

#265896
Sep 21, 2013 at 6:57pm

Thank you Christopher and Mike! I am testing out the delay feature now (need to be certain over 30 minutes not just the 5 seconds I tried first) though I am sure it will work. Mike your option was also very effective thank you. The trick with this installation is that I may not be able to be there so I have to design it to be idiot proof and to turn off when the time is up.

#265900

You must be logged in to reply to this topic.