Automatically Turn a Toggle On and Off in Max MSP - max

How do I automatically turn a toggle on and off in Max MSP? For instance, if I want this toggle to print out this message for 30 seconds, and then stop printing for 30 seconds, and then on and off again by itself for a set period of time without me manually adjusting it, what should I do?

To turn a toggle on or off every 30 seconds, you can connect it to the output of a [metro 30000] object.

Related

AHK Timing from 60 to 0

When I press (example) f:: my time starts counting down from 60seconds to 0s. In the last two seconds I have to press f:: and the countdown must start again from 60 to 0.
Is it possible through AHK to make me press with f:: anytime within 60 sec and AHK to click within the last two seconds. I don't need it for a computer game and any help would be greatly appreciated.
So far I haven't tried anything because either it doesn't exist, or I been looking in the wrong place.

how to fix when i switch tab value delta time is change

when switch tab 5-10 sec and switch back value is changed because fps drop to 8fps and back to normal how to fix.
This is expected behavior. From MDN:
requestAnimationFrame() calls are paused in most browsers when running
in background tabs or hidden <iframe>s in order to improve performance
and battery life.

Live Timer // Parse & Swift

Im trying to figure out how can I do a live 30 second timer which every 30 second something happens. No matter who opens the app the timer will continue to run even if you just open the app and the timer might be on 20s or 10s or even 1s. And right when it hits zero, I have something that pops up.
I have it done but it's a timer that starts when the app is view is opened and always starts from 30s and if someone else opens the app he also starts from 30s i want it so that who ever opens the view the timer is still running.

disable mouse multiclick and change doubleclick interval

is there a way to disable multiclicks? By multiclicks I mean 3-or more clicks. I would like to have only singleClick or doubleClick. The third click should be always registered as singleClick (clicks=1). event.mouse.clicks should always be <= 2.
Another problem is the interval between clicks. If I click multiple times on the same spot between 1-2 seconds, it is always registered as a multiClick (event.mouse.clicks keeps rising). Only if I move the cursor a bit, clicks would lover to 1. How can I change this behavior so the interval between click and doubleClick will be around 1/4 second?
Solution is to have a separate thread which reads the SDL information, then do a debounce algorithm to remove the unwanted clicks. I did this for a touch screen, which is too sensitive. After filtering, you should get what you want. Then the filtered events you put in a queue (std::deque) which can be used for the real user interface to get events.
The open source project https://sourceforge.net/p/sdl2ui/wiki/Home/ has a class CdialogEvent which is may just what you need.

How can I display the number of seconds until an NSTimer next fires

I have a simple OSX Menubar application, the status item has a menu attached to it and I have a menu item that can manually send a fire to a NSTimer.
I'd like for that menu item to display the number of seconds until the next time the timer will be fired. Is there a way to get the amount of time until the next fire or the time at which the NSTimer will be next fired?
NSTimer has fireDate wich returns a NSDate. NSDate has timeIntervalSinceNow.
I know there’s already an accepted answer, but it just occurred to me, that you actually may not be interested in the fireDate, at all:
Using that date, you’ll only see the same number of seconds, for as long as the time is displayed — if it’s displayed directly in the menu bar, there is no indication of progress…
I’d therefor suggest a slightly different approach:
Calculate, and store the expiry date.
Schedule a repeating timer, that fires at an interval matching your displayed precision, and updates the remaining time display, using the stored expiry date.
As soon, as you’ve passed the expiry date, invalidate the timer, and do whatever it is you want to do, then.
So, why not use a one second timer, and a decrementing counter variable, then?
Simple: NSTimer is not a real-time thing. The actual date a timer fires, and its scheduled fireDate will be slightly different. But since repeating timers re-schedule without adjusting for that difference, these deviations add up.
These deviations are completely unpredictable, as they depend not only on the load of your App, but the system as a whole. So they will vary between “completely neglible”, and “ZOMFG”!

Resources