Skip to contents

The pattern order table is a vector of numeric indices of PTPattern tables, which determines in which order the patterns need to be played. This method returns the visible length of this vector.

Usage

# S4 method for PTModule
patternOrderLength(x)

# S4 method for PTModule,numeric
patternOrderLength(x) <- value

Arguments

x

A PTModule object for which the length of the visible part of the pattern order table is to be returned.

value

A numeric value which is to be used to set the visible length of the pattern order table.

Value

For patternOrderLength the visible length of the pattern order table of PTModule

x is returned as a numeric

value, ranging from 1 up to 128.

For patternOrderLength<- an updated version of object x is returned, in which the visible length of the pattern order table is set to value. Note that this does not change the pattern order table itself, only which part is `visible'.

Details

The actual length of the vector containing the pattern order is 128 as per ProTracker standards. Only part of this vector is `visible' and will be used to determine in which order pattern tables are to be played. The length returned by this method is the length of this visible part of the pattern order table. The length of this visible part can also be set with this method.

Author

Pepijn de Vries

Examples

data("mod.intro")

## get the length of the pattern order table:
patternOrderLength(mod.intro)
#> [1] 9

## set the length of the pattern order table to 1:
patternOrderLength(mod.intro) <- 1

## note that the pattern order table remained intact:
patternOrder(mod.intro, full = TRUE)
#>   [1] 0 0 1 1 2 2 3 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#>  [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#>  [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0