Module xStreamBuffer

choose a mute mode NONE = do nothing except to output 'nothing'

note: when combined with 'clear', this makes it possible to
record into a track, using the mute button as a 'output switch'

OFF = insert OFF across columns, then nothing

TODO when 'clear_undefined' is true, OFF is only written when
there is not an existing note at that position

Functions

__init (xpos) [Constructor]
update_read_buffer () update all content ahead of our position method is called when xStreamPos is changing position 'abruptly'
_wipe_past () wipe all data behind our current position (see also xStreamArgs)
wipe_futures () Forget all output ahead of our current write-position - call when fresh content needs to be produced in the next cycle
clear () Clear when preparing to stream
_get_songpos (xinc) Return song position based on buffer position
schedule_line (xline, xinc) schedule an xline
schedule_note_column (xnotecol, col_idx, xinc) schedule a single column (merge into existing xline)
schedule_effect_column (xeffectcol, col_idx, xinc) schedule a single column (merge into existing xline)
_get_xinc (offset) get the buffer index relative to our position (used for scheduling) note that counting starts from current line when parked
mute () trigger mute event (schedule note-offs if configured to)
_create_content (num_lines, xinc) Create content: process #numlines using our callback method, and update outputbuffer with result
get_output (xinc) Retrieve content (scheduled or regular output)
set_buffer (xinc, xline) Set output for a given position
read_from_pattern (xinc, pos) Read a line from the pattern (or scheduled, if it exists)
immediate_output () For time-critical situations, perform immediate output for the upcoming line
write_output (pos, xinc, num_lines, live_mode) Write #num_lines into the pattern-track and/or automation lane (call periodically when streaming in realtime, or directly when processing offline)
write_line (xline, pos, phrase, patt_num_lines) Write a single line at the specified position
resolve_automation (seq_idx) Resolve or create automation for parameter in the provided seq-index can return nil if trying to create automation on non-automateable param.

Fields

self.xpos xStreamPos, drives this class
self.callback provide a function that generates instances of xLine
self.callback_status_observable string, value depends on success/failure during last callback "" = no problem "Some error occurred" = description of error
self.track_index int, decide which track to target (0 = none)
self.mute_mode xStreamBuffer.MUTE_MODE, controls how muting is done
self.expand_columns boolean, whether to expand (sub-)columns when writing data
self.include_hidden boolean, whether to include hidden (not visible) columns
self.clear_undefined boolean, determine how to respond to 'undefined' content
self.automation_playmode xStreamBuffer.PLAYMODE, the preferred automation playmode
self.output_buffer table, buffer containing regular output
self.scheduled table, buffer containing scheduled content
self.highest_xinc int, keep track of the highest/lowest line in our output buffer (content that is up to date and ready for output)
self.mute_xinc int, the mute buffer index, nil when not muted
self.empty_xline xLine, used whenever we need a completely blank line


Functions

__init (xpos)
[Constructor]

Parameters:

  • xpos
update_read_buffer ()
update all content ahead of our position method is called when xStreamPos is changing position 'abruptly'
_wipe_past ()
wipe all data behind our current position (see also xStreamArgs)
wipe_futures ()
Forget all output ahead of our current write-position - call when fresh content needs to be produced in the next cycle
clear ()
Clear when preparing to stream
_get_songpos (xinc)
Return song position based on buffer position

Parameters:

  • xinc (int)

Returns:

    SongPos
schedule_line (xline, xinc)
schedule an xline

Parameters:

  • xline
  • xinc
schedule_note_column (xnotecol, col_idx, xinc)
schedule a single column (merge into existing xline)

Parameters:

  • xnotecol
  • col_idx
  • xinc
schedule_effect_column (xeffectcol, col_idx, xinc)
schedule a single column (merge into existing xline)

Parameters:

  • xeffectcol
  • col_idx
  • xinc
_get_xinc (offset)
get the buffer index relative to our position (used for scheduling) note that counting starts from current line when parked

Parameters:

  • offset (int), number of lines

Returns:

    int
mute ()
trigger mute event (schedule note-offs if configured to)
_create_content (num_lines, xinc)
Create content: process #numlines using our callback method, and update outputbuffer with result

Parameters:

  • num_lines (int)
  • xinc (number)
get_output (xinc)
Retrieve content (scheduled or regular output)

Parameters:

  • xinc

Returns:

    xLine
set_buffer (xinc, xline)
Set output for a given position

Parameters:

  • xinc (int)
  • xline (xLine or table) the content to insert
read_from_pattern (xinc, pos)
Read a line from the pattern (or scheduled, if it exists)

Parameters:

  • xinc (int), the buffer position
  • pos ] (SongPos), where to read from song

Returns:

    xLine, xline descriptor (never nil)
immediate_output ()
For time-critical situations, perform immediate output for the upcoming line
write_output (pos, xinc, num_lines, live_mode)
Write #num_lines into the pattern-track and/or automation lane (call periodically when streaming in realtime, or directly when processing offline)

Parameters:

  • pos (SongPos)
  • xinc (int), buffer position
  • num_lines ] (int), use writeahead if not defined
  • live_mode (bool), skip line at playpos when true
write_line (xline, pos, phrase, patt_num_lines)
Write a single line at the specified position

Parameters:

  • xline , xLine
  • pos , SongPos
  • phrase ], renoise.InstrumentPhrase
  • patt_num_lines , number
resolve_automation (seq_idx)
Resolve or create automation for parameter in the provided seq-index can return nil if trying to create automation on non-automateable param.

Parameters:

  • seq_idx (int)

Returns:

    renoise.PatternTrackAutomation or nil

Fields

self.xpos
xStreamPos, drives this class
self.callback
provide a function that generates instances of xLine
self.callback_status_observable
string, value depends on success/failure during last callback "" = no problem "Some error occurred" = description of error
self.track_index
int, decide which track to target (0 = none)
self.mute_mode
xStreamBuffer.MUTE_MODE, controls how muting is done
self.expand_columns
boolean, whether to expand (sub-)columns when writing data
self.include_hidden
boolean, whether to include hidden (not visible) columns
self.clear_undefined
boolean, determine how to respond to 'undefined' content
self.automation_playmode
xStreamBuffer.PLAYMODE, the preferred automation playmode
self.output_buffer
table, buffer containing regular output
self.scheduled
table, buffer containing scheduled content
self.highest_xinc
int, keep track of the highest/lowest line in our output buffer (content that is up to date and ready for output)
self.mute_xinc
int, the mute buffer index, nil when not muted
self.empty_xline
xLine, used whenever we need a completely blank line
generated by LDoc 1.4.2