Page tree
Skip to end of metadata
Go to start of metadata

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

beatsTime 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

4 Comments

  1. I had to change something. Please read again.

     

    You can use the Page History to find out what has changed.

  2. And again: proofread done