Skip to contents

Extract or replace the loop start position of a PTSample.

Usage

# S4 method for PTSample
loopStart(sample)

# S4 method for PTSample
loopStart(sample) <- value

Arguments

sample

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

value

An even numeric value giving the loop starting position in samples ranging from 0 up to 131070. 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.

Value

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

For loopStart<- A PTSample

sample, updated with the loop start position ``value`', is returned.

Details

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

See also

Author

Pepijn de Vries

Examples

data("mod.intro")

## get the loop start position of the
## first sample of mod.intro:

loopStart(PTSample(mod.intro, 1))
#> [1] 762

## Let's change the starting position of
## the loop to 500

loopStart(PTSample(mod.intro, 1)) <- 500

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

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