Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sampleNumber

Extract or replace a sample number


Description

Extract or replace a PTSample index number from a PTCell object.

Usage

## S4 method for signature 'PTCell'
sampleNumber(x)

## S4 replacement method for signature 'PTCell,numeric'
sampleNumber(x) <- value

Arguments

x

A PTCell object from which the PTSample index number needs to be be extracted or replaced.

value

A numeric replacement value for the index. Valid indices range from 1 up to 31. A value of 0 can also be assigned, but will not play any sample.

Details

The PTSample index number in a PTCell object, indicates which sample from a PTModule object needs to be played. This method can be used to extract or replace this index from a PTCell object.

Value

For sampleNumber, a numeric value representing the sample index number of object x is returned.

For sampleNumber<-, an copy of object x is returned in which the sample index number is replaced with value.

Author(s)

Pepijn de Vries

See Also

Other cell.operations: PTCell-class, PTCell-method, effect(), note()

Examples

data("mod.intro")

## get the sample index number of PTCell at pattern #3,
## track #2, row #1 from mod.intro (which is 2):

sampleNumber(PTCell(mod.intro, 1, 2, 3))

## replace the sample index number of PTCell at pattern #3,
## track #2, row #1 from mod.intro with 1:

sampleNumber(PTCell(mod.intro, 1, 2, 3)) <- 1

ProTrackR

Manipulate and Play 'ProTracker' Modules

v0.3.7
GPL-3
Authors
Pepijn de Vries [aut, cre, dtc]
Initial release
2020-02-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.