Module xPlayPos

Extended play-position which support fractional time (between lines).

How to use

-- create an instance of the class
local pos = xPlayPos()

-- set to some position
pos(rns.transport.playback_pos)

-- call update() when idle to track playback
pos:update()

-- ask for the expanded position
pos()

-- get any specific property:
-- pos.fraction
-- pos.sequence)
-- pos.line

-- to return it as a normal SongPos object
xSongPos.create(pos)

Functions

get_line () Getters/Setters
update () Class Methods
set (pos)
__call () note: a realtime version of this method exists below
get (pos, beats) [Static] Obtain a fraction position (only revelant while playback is active)
has_changed (pos)
maintain_position (pos) look for when we enter a 'beat' in the global timeline

Fields

self.line int, read-only
self.sequence int, read-only


Functions

get_line ()
Getters/Setters
update ()
Class Methods call as often as possible to maintain/track position
set (pos)

Parameters:

  • pos (SongPos)
__call ()
note: a realtime version of this method exists below

Returns:

    table (like SongPos but with extra 'fraction' field)
get (pos, beats)
[Static] Obtain a fraction position (only revelant while playback is active)

Parameters:

  • pos
  • beats

Returns:

  1. table (like songpos, but with 'fraction', a number between 0-1)
  2. boolean
has_changed (pos)

Parameters:

  • pos SongPos

Returns:

    boolean
maintain_position (pos)
look for when we enter a 'beat' in the global timeline

Parameters:

  • pos within the first line of a "song beat"?

Fields

self.line
int, read-only
self.sequence
int, read-only
generated by LDoc 1.4.2