| PTPattern-method | R Documentation |
This method will coerce a set of objects to a PTPattern object. It can also
be used to select specific patterns from PTModule objects and replace
the selected PTPattern.
## S4 method for signature 'raw,missing'
PTPattern(x)
## S4 method for signature 'matrix,missing'
PTPattern(x)
## S4 method for signature 'PTModule,numeric'
PTPattern(x, pattern)
## S4 replacement method for signature 'PTModule,numeric,PTPattern'
PTPattern(x, pattern) <- value
x |
Object (any of |
pattern |
When |
value |
An object of |
Method to coerce x to class PTPattern.
When x is a 64 by 16 matrix of raw data, each row
implicitly represents the PTCell objects of each of the
four tracks. Each PTCell consists of four raw
values. The values in each row are formatted accordingly, where the values of the
cells of each track are concatenated. See PTCell documentation for
more details on the raw format of a PTCell object.
When x is a 64 by 16 matrix of character representations
of PTCell objects, the character representation must be
conform the specifications as documented at the PTCell.
When x is of class PTModule, the PTPattern at the
specified index (pattern) is returned, or can be replaced.
When PTPattern is used, a PTPattern object
based on x is returned.
When PTPattern<- is used, object x is returned in which
the selected PTPattern is replaced with value.
Pepijn de Vries
Other pattern.operations:
MODPlugToPTPattern(),
PTPattern-class,
PTPatternToMODPlug(),
appendPattern(),
deletePattern(),
pasteBlock(),
patternLength(),
patternOrderLength(),
patternOrder()
## This will create an 'empty' PTPattern with
## all 0x00 values, which is equivalent to
## new("PTPattern"):
PTPattern(as.raw(0x00))
## Create a PTPattern based on repeated
## PTCell character representations:
pat <- PTPattern(matrix("F#2 1A 20A", 64, 4))
data("mod.intro")
## Replace the first pattern in the patternOrder
## table in mod.intro with 'pat' (don't forget to
## add one (+1) to the index):
PTPattern(mod.intro,
patternOrder(mod.intro)[1] + 1) <- pat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.