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

getBeatDuration()

Description

Function to obtain the duration of one beat in milliseconds.

Available in: Processor.

Return Values

Returns the duration of one beat in milliseconds. The duration of one beat equals the length of a quarter note based on the current tempo. If no tempo information is available, this function returns the value -1.

Example

-- play notes with a fixed length of one beat
function onNote(event)
  playNote(event.note, event.velocity, getBeatDuration())
end
function onRelease(event)
  -- eat the release, no postEvent(event)
end

1 Comment