SpeedLim does the same thing as [speedlim] in Max: Given an incoming stream of data, it passes through updates only after a period of time. Use this for GUI, MIDI or OSC control streams where too many messages are being sent per second and you want to slow down SC's response.
More specifically:
time
seconds will be dropped.time
seconds.Unlike SkipJack, there is no guarantee of exact periodicity. But, SpeedLim will react immediately if it's idle (where SkipJack simply quantizes time). Also, SkipJack will fire its action even if there is no update; SpeedLim avoids redundant actions.
Create a new instance.
time |
Minimum number of seconds between firing the action. |
action |
A function that will be called with updates. It takes any number of arguments, corresponding to values passed from the upstream caller. See the "argument passing" example below. |
clock |
Optional. You may specify a clock for scheduling future updates. The default is SystemClock, although AppClock may be used if you expect to run GUI updates in response to incoming messages. |
The SpeedLim instance.
Update the SpeedLim value, and fire the action when needed. This is analogous to an incoming message in the Max [speedlim] object. If not enough time has passed, the action will be delayed.
Because this is value
and not value_
, a SpeedLim can be used in place of an action function in GUI objects, MIDIFuncs and OSCFuncs.
... invals |
Any value(s) serving as the update. There is no restriction on datatype. They will be passed as-is to the action function, as multiple arguments if several values were passed in initially. |
Self.
Get or set the time period.
Get or set the action function.
Get or set the clock.