effect {ProTrackR} | R Documentation |
Extract or replace effect/trigger codes
Description
The 3 right-hand symbols of a character
representation of a
PTCell
represent an effect or trigger code. This method
can be used to extract or replace this code.
Usage
## S4 method for signature 'PTCell'
effect(x)
## S4 replacement method for signature 'PTCell,character'
effect(x) <- value
Arguments
x |
A |
value |
A |
Details
When a PTCell
is represented by a character
string,
the last three symbols represent a hexadecimal effect or trigger code.
In general the first of the three symbols indicates a type of effect or
trigger, whereas the latter two generally indicate a magnitude or a
position for effects and triggers.
Effects can for instance be volume or frequency slides. The codes can also affect the module tempo or cause position jumps.
When replacing this code, all three digit hexadecimal character
strings are accepted, although not all codes will represent a valid
effect or trigger. See
https://wiki.openmpt.org/Manual:_Effect_Reference#MOD_Effect_Commands
for a valid list of effect codes.
Value
For effect
, a character
string with the three hexadecimal
digit effect code will be returned.
For effect<-
, a copy of object x
with effect code value
will be returned.
Author(s)
Pepijn de Vries
See Also
Other cell.operations:
PTCell-class
,
PTCell-method
,
note()
,
sampleNumber()
Examples
data("mod.intro")
## the PTCell in row #1, of pattern #1, track #1
## has effect code "A08", which is a volume slide down (0xA)
## with speed 0x8:
effect(PTCell(mod.intro, 1, 1, 1))
## this is how you can change an effect:
cell <- PTCell("C-2 01 000")
effect(cell) <- "C20"
## the above expression sets the volume (effect 0xC)
## to 50% (0x20 which is halve of the maximum 0x40)