Module xStreamPos

This class can track playback progression in a song .

How to use

Create an instance, and supply it with a steady flow of song-position changes (idle loop).

Requires

xPlayPos xSongPos xBlockLoop

Functions

set_pos (pos) Update the write position as a result of a changed playback position.
track_pos () This function is designed to be called in an idle loop
attach_to_song () call when a new document becomes available

Fields

self.playpos (xPlayPos) monitor changes to playback self.playpos = rns.transport.playback_pos
self.writepos (xSongPos) overall progression of the stream
self.readpos (xSongPos) where we most recently read from the pattern
self.xblock (xBlockLoop)
self.block_enabled bool, track changes to loopblockenabled TODO refactor into xBlockloop
self.writeahead (int) 0 if undefined implementation should supply this number - used for deciding when we are approaching the boundary of a pattern/block
self.just_started_playback number, or 0 if undefined this is a short-lived timestamp indicating that we should ignore changes to the playback position, right after playback has started (the fuzziness is due to API living in separate thread)
self.callback_fn function, define a function to call when it's time for output
self.refresh_fn TODO function, define a function to call when we need fresh content (i.e.


Functions

set_pos (pos)
Update the write position as a result of a changed playback position. Most of the time we want the stream to continue smoothly forward - this is true for any kind of pattern, sequence or block loop. However, when we detect 'user' events, the position can also jump backwards (the detection of these events is not entirely reliable near loop boundaries)

Parameters:

  • pos , renoise.SongPos
track_pos ()
This function is designed to be called in an idle loop
attach_to_song ()
call when a new document becomes available

Fields

self.playpos
(xPlayPos) monitor changes to playback self.playpos = rns.transport.playback_pos
self.writepos
(xSongPos) overall progression of the stream
self.readpos
(xSongPos) where we most recently read from the pattern
self.xblock
(xBlockLoop)
self.block_enabled
bool, track changes to loopblockenabled TODO refactor into xBlockloop
self.writeahead
(int) 0 if undefined implementation should supply this number - used for deciding when we are approaching the boundary of a pattern/block
self.just_started_playback
number, or 0 if undefined this is a short-lived timestamp indicating that we should ignore changes to the playback position, right after playback has started (the fuzziness is due to API living in separate thread)
self.callback_fn
function, define a function to call when it's time for output
self.refresh_fn
TODO function, define a function to call when we need fresh content (i.e. when the position has been changed by the user, and previously produced content no longer would be valid...)
generated by LDoc 1.4.2