Some control sources run at very fast rates, which may cause too much CPU load by running triggered functions too often. SpeedLimit limits these by keeping a minimum time between updates, while making sure slower messages are executed immediately.
First code examples:
make a new speedlimit
action |
the action to run when triggered |
dt |
the minimum time to wait before re-triggering |
the action to run when triggered
the minimum time to wait before re-triggering
Trigger speedLimit action, if limiting permits. this is used in place of triggeredFunction.value(*args);
... args |
last time a trigger, i.e. a call to filterValue came in a.now //
last time the action ran
the list of latest arguments received
flag whether there is currently a scheduled next trigger
difference between lastTime and incoming now