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

loopLength

The loop length of a PTSample


Description

Extract or replace the loop length of a PTSample.

Usage

## S4 method for signature 'PTSample'
loopLength(sample)

## S4 replacement method for signature 'PTSample'
loopLength(sample) <- value

Arguments

sample

A PTSample for which the loop length needs to be extracted or replace.

value

An even numeric value giving the loop length in samples ranging from 2 up to 131070 (It can be 0 when the sample is empty). The sum of the loopStart and loopLength should not exceed the sampleLength.

Use a value of either character "off" or logical "FALSE", in order to turn off the loop all together.

Details

PTSamples can have loops, marked by a starting position and length of the loop (in samples), for more details see the PTSample-class. This method can be used to extract the loop length or safely replace its value.

Value

For loopLength the loop length (in samples), represented by an even integer value ranging from 0 up to 131070, is returned.

For loopLength<- A PTSample sample, updated with the loop length 'value', is returned.

Author(s)

Pepijn de Vries

See Also

Other loop.methods: loopSample(), loopStart(), loopState()

Examples

data("mod.intro")

## get the loop length of the
## first sample of mod.intro:

loopLength(PTSample(mod.intro, 1))

## Let's change the length of
## the loop to 200

loopLength(PTSample(mod.intro, 1)) <- 200

## Let's turn off the loop all together:

loopLength(PTSample(mod.intro, 1)) <- FALSE

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.