Learn R Programming

ProTrackR (version 0.4.4)

appendPattern: Append a PTPattern to a PTModule

Description

Appends a specified PTPattern to a PTModule.

Usage

# S4 method for PTModule,PTPattern
appendPattern(x, pattern)

Value

Returns a PTModule, to which the PTPattern is appended.

Arguments

x

A PTModule object to which a PTPattern is to be appended.

pattern

A PTPattern object which is to be appended to the PTModule x.

Author

Pepijn de Vries

Details

Depending on the trackerFlag, a ProTracker module can hold either 64 or 100 pattern tables. As long as the number of pattern tables is below this maximum, new pattern tables can be added to the module with this function.

The patternOrder table should hold the maximum index of the available pattern tables in a module, otherwise, the module is not valid. As the maximum index increases, by appending a pattern table, the patternOrder table should be updated. The appendPattern method does this automatically, by replacing the first non-unique index in the order table, outside the current order table's length, with the new maximum index. If this is not possible, the highest element in the order table is set to hold the maximum index.

See Also

Other pattern.operations: MODPlugToPTPattern(), PTPattern-class, PTPattern-method, PTPatternToMODPlug(), deletePattern(), pasteBlock(), patternLength(), patternOrderLength(), patternOrder()

Other module.operations: PTModule-class, clearSamples(), clearSong(), deletePattern(), fix.PTModule(), modToWave(), moduleSize(), patternLength(), patternOrderLength(), patternOrder(), playMod(), playingtable(), rawToPTModule(), read.module(), trackerFlag(), write.module()

Examples

Run this code
data("mod.intro")

## append an empty pattern to mod.intro

mod.intro <- appendPattern(mod.intro, new("PTPattern"))

## append a copy of pattern # 1 (this is pattern #0 in the
## patternOrder table) to mod.intro

mod.intro <- appendPattern(mod.intro, PTPattern(mod.intro, 1))

Run the code above in your browser using DataLab