wait(ms)
Description
Function to suspend the execution of a callback for a specific time in milliseconds.
If the wait function is used in the Controller thread, it operates at a lower rate and is therefore less accurate.
Available in: Controller, Processor.
Arguments
ms | Time in ms. | number |
---|
Example
-- delay notes which have not been released for 1000 ms local initTime = getTime() local releaseTime = {} function onNote(event) local noteOnTime = getTime() wait(1000) if noteOnTime > (releaseTime[event.note] or initTime) then postEvent(event) end end function onRelease(event) releaseTime[event.note] = getTime() postEvent(event) end
See Also: waitBeat, waitForRelease, spawn, runAsync, runSync
3 Comments
Sabine Pfeifer
proofread done
Matthias Klag
I had to change something. Please check again.
To find out what has changed: The Page History of Confluence allows you to compare the latest versions of this page.
Sabine Pfeifer
proofread done