/ HALion Developer Resource / HALion Script / Reference /

getBarDuration

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

See also: getBeatDuration, getNoteDuration