renoise.Pattern

Constants

MAX_NUMBER_OF_LINES : integer

Maximum number of lines that can be present in a pattern.


Properties

is_empty : boolean

Quickly check if any track in a pattern has some non empty pattern lines. This does not look at track automation.

name : string

Name of the pattern, as visible in the pattern sequencer.

name_observable : renoise.Document.Observable

Track changes to document properties or general states by attaching listener functions to it.

number_of_lines : integer

Number of lines the pattern currently has. 64 by default. Max is renoise.Pattern.MAX_NUMBER_OF_LINES, min is 1.

number_of_lines_observable : renoise.Document.Observable

Track changes to document properties or general states by attaching listener functions to it.

tracks : renoise.PatternTrack[]

READ-ONLY Access to the pattern tracks. Each pattern has #renoise.song().tracks amount of tracks.


Functions

clear(self)

Deletes all lines & automation.

copy_from(self, other : renoise.Pattern)

Copy contents from other patterns, including automation, when possible.

track(self, index : integer)

->renoise.PatternTrack

Access to a single pattern track by index. Use properties 'tracks' to iterate over all tracks and to query the track count.

has_line_notifier(self, func : PatternLineChangeCallbackWithContext, obj : table | userdata)

->boolean

Check/add/remove notifier functions or methods, which are called by Renoise as soon as any of the pattern's lines have changed. The notifiers are called as soon as a new line is added, an existing line is cleared, or existing lines are somehow changed (notes, effects, anything)

A single argument is passed to the notifier function: "pos", a table with the fields "pattern", "track" and "line", which defines where the change has happened.

examples:

function my_pattern_line_notifier(pos)
  -- check pos.pattern, pos.track, pos.line (all are indices)
end

Please be gentle with these notifiers, don't do too much stuff in there. Ideally just set a flag like "pattern_dirty" which then gets picked up by an app_idle notifier: The danger here is that line change notifiers can be called hundreds of times when, for example, simply clearing a pattern.

If you are only interested in changes that are made to the currently edited pattern, dynamically attach and detach to the selected pattern's line notifiers by listening to "renoise.song().selected_pattern_observable".

add_line_notifier(self, func : PatternLineChangeCallbackWithContext, obj : table | userdata)

remove_line_notifier(self, func : PatternLineChangeCallbackWithContext, obj : table | userdata)

has_line_edited_notifier(self, func : PatternLineChangeCallbackWithContext, obj : table | userdata)

->boolean

Same as line_notifier, but the notifier only fires when the user added, changed or deleted a line with the computer or MIDI keyboard.

add_line_edited_notifier(self, func : PatternLineChangeCallbackWithContext, obj : table | userdata)

remove_line_edited_notifier(self, func : PatternLineChangeCallbackWithContext, obj : table | userdata)


Local Structs

PatternLinePosition

Line iterator position.


Properties

pattern : integer

track : integer

line : integer


Local Aliases

PatternLineChangeCallbackWithContext

(obj : table | userdata, pos : PatternLinePosition)