struct
SunVox::Pattern
- SunVox::Pattern
- Struct
- Value
- Object
Overview
High-level wrapper around a tracker pattern inside a SunVox::Slot.
Defined in:
pattern.crConstructors
Instance Method Summary
-
#[](track : Int32, line : Int32) : SunVox::Event
Reads the
SunVox::Eventat(track, line). -
#[]=(track : Int32, line : Int32, event : SunVox::Event) : SunVox::Event
Writes
#eventto the cell at(track, line). -
#data : Array(Array(SunVox::Event))
Returns all pattern events organized by track (
Array(Array(SunVox::Event))). -
#event(track : Int32, line : Int32) : SunVox::Event
Reads the full
SunVox::Eventat(track, line). -
#exists? : Bool
Returns true if this pattern slot is non-empty (
lines > 0). -
#get_event_field(track : Int32, line : Int32, column : PatternColumn | Int32) : Int32
Reads a single column value from the cell at
(track, line). - #id : Int32
-
#lines : Int32
Gets the number of lines in this pattern.
-
#lines=(new_lines : Int32) : Int32
Sets the number of lines in this pattern.
-
#mute!(mute : Bool = true) : Bool
Mutes (or unmutes) this pattern and returns its previous mute state.
-
#muted=(mute : Bool) : Bool
Sets the mute state of this pattern.
-
#muted? : Bool
Returns true if this pattern is currently muted.
-
#name : String
Gets the pattern's name.
-
#name=(new_name : String) : String
Sets the pattern's name.
-
#raw_data : Slice(LibSunVox::Event)
Returns a direct mutable
Slice(LibSunVox::Event)into the underlying SunVox pattern buffer. -
#remove! : Nil
Removes this pattern from its slot.
-
#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). -
#set_event(track : Int32, line : Int32, event : SunVox::Event) : self
Writes a full
SunVox::Eventto the cell at(track, line). -
#set_size(tracks : Int32 = -1, lines : Int32 = -1) : self
Resizes this pattern (
-1leaves a dimension unchanged). -
#set_xy(x : Int32, y : Int32) : self
Sets the pattern's
(x, y)coordinates on the timeline. - #slot : Slot
-
#to_i : Int32
Returns the integer pattern ID.
-
#tracks : Int32
Gets the number of tracks in this pattern.
-
#tracks=(new_tracks : Int32) : Int32
Sets the number of tracks in this pattern.
-
#unmute! : Bool
Unmutes this pattern and returns its previous mute state.
-
#x : Int32
Gets the pattern's X position (start line number on the timeline).
-
#x=(new_x : Int32) : Int32
Sets the pattern's X coordinate (start line on timeline).
-
#xy : NamedTuple(x: Int32, y: Int32)
Gets the pattern's
{x, y}coordinates on the timeline. -
#y : Int32
Gets the pattern's Y position (vertical position on the timeline).
-
#y=(new_y : Int32) : Int32
Sets the pattern's Y coordinate on the timeline.
Constructor Detail
Instance Method Detail
Writes #event to the cell at (track, line).
Returns all pattern events organized by track (Array(Array(SunVox::Event))).
Reads the full SunVox::Event at (track, line).
Reads a single column value from the cell at (track, line).
Mutes (or unmutes) this pattern and returns its previous mute state.
Returns a direct mutable Slice(LibSunVox::Event) into the underlying SunVox pattern buffer.
Writes fields to a cell at (track, line). Negative arguments leave the corresponding field unchanged.
Writes a full SunVox::Event to the cell at (track, line).
Resizes this pattern (-1 leaves a dimension unchanged).