Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Example

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

...