struct

SunVox::Pattern

Inherits Struct < Value < Object

High-level wrapper around a tracker pattern inside a SunVox::Slot.

Constructors

new(slot : Slot, id : Int32)
Source

Instance methods

[](track : Int32, line : Int32) : SunVox::Event

Reads the SunVox::Event at (track, line).

Source
[]=(track : Int32, line : Int32, event : SunVox::Event) : SunVox::Event

Writes event to the cell at (track, line).

Source
data

Returns all pattern events organized by track (Array(Array(SunVox::Event))).

Source
event(track : Int32, line : Int32) : SunVox::Event

Reads the full SunVox::Event at (track, line).

Source
exists?

Returns true if this pattern slot is non-empty (lines > 0).

Source
get_event_field(track : Int32, line : Int32, column : PatternColumn | Int32) : Int32

Reads a single column value from the cell at (track, line).

Source
lines

Gets the number of lines in this pattern.

Source
lines=(new_lines : Int32) : Int32

Sets the number of lines in this pattern.

Source
mute!(mute : Bool = true) : Bool

Mutes (or unmutes) this pattern and returns its previous mute state.

Source
muted=(mute : Bool) : Bool

Sets the mute state of this pattern.

Source
muted?

Returns true if this pattern is currently muted.

Source
name

Gets the pattern's name.

Source
name=(new_name : String) : String

Sets the pattern's name.

Source
raw_data

Returns a direct mutable Slice(LibSunVox::Event) into the underlying SunVox pattern buffer.

Source
remove!

Removes this pattern from its slot.

Source
set_event(track : Int32, line : Int32, note : Note | Int32 = -1, velocity : Int32 = -1, mod : Module | Int32 = -1, ctl : Int32 = -1, effect : Int32 = -1, ctl_value : Int32 = -1) : self

Writes fields to a cell at (track, line). Negative arguments leave the corresponding field unchanged.

Source
set_event(track : Int32, line : Int32, event : SunVox::Event) : self

Writes a full SunVox::Event to the cell at (track, line).

Source
set_size(tracks : Int32 = -1, lines : Int32 = -1) : self

Resizes this pattern (-1 leaves a dimension unchanged).

Source
set_xy(x : Int32, y : Int32) : self

Sets the pattern's (x, y) coordinates on the timeline.

Source
slot
Source
to_i

Returns the integer pattern ID.

Source
tracks

Gets the number of tracks in this pattern.

Source
tracks=(new_tracks : Int32) : Int32

Sets the number of tracks in this pattern.

Source
unmute!

Unmutes this pattern and returns its previous mute state.

Source
x

Gets the pattern's X position (start line number on the timeline).

Source
x=(new_x : Int32) : Int32

Sets the pattern's X coordinate (start line on timeline).

Source
xy

Gets the pattern's {x, y} coordinates on the timeline.

Source
y

Gets the pattern's Y position (vertical position on the timeline).

Source
y=(new_y : Int32) : Int32

Sets the pattern's Y coordinate on the timeline.

Source