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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »



Function to obtain the current song position in number of beats (quarter notes).

Available in: Processor.

Return Values

When the host is in playback, the function returns a decimal with the number of beats (quarter notes) since the start of the song. The start of the song equals 0 beats. The function returns -1, if the host is not in playback.


--print the song position in number of beats
function onNote(event)
	posInSong = getBeatTime()
	if (posInSong ~= -1) then
        print(string.format("%.3f beats", posInSong)
        print("Playback is stopped.") 

See Also: onNote

  • No labels