waitBeat(beats)
Description
Function to suspend the execution of a callback for a specific time. This time is specified in number of beats. One beat equals the length of a quarter note based on the current tempo.
If the waitBeat function is used in the Controller thread, it operates at a lower rate and is therefore less accurate.
Available in: Controller, Processor.
Arguments
beats | Time in number of quarter notes and fractions of it. | number |
---|
Example
-- change tuning cyclically after one beat function onNote(event) local id = postEvent(event) while isNoteHeld() do waitBeat(1) local tune = math.random() * 12 - 6 changeTune(id, tune, false, false) end end
See Also: wait, waitForRelease, spawn, runAsync, runSync
4 Comments
Sabine Pfeifer
proofread done
Matthias Klag
I had to change something. Please read again.
You can use the Page History to find out what has changed.
Sabine Pfeifer
proofread done
Sabine Pfeifer
And again: proofread done