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

getBarDuration()

Description

Function to obtain the duration of one bar in milliseconds.

Available in: Processor.

Return Values

Returns the duration of one bar in milliseconds based on the current time signature and tempo. If no time signature or tempo are available, this function returns the value -1.

Example

-- limit the note length to one bar
function onNote(event)
  playNote(event.note, event.velocity, getBarDuration())
end

1 Comment