| loopSample | R Documentation |
Generate a looped waveform of a PTSample object.
## S4 method for signature 'PTSample'
loopSample(sample, times, n_samples)
sample |
A |
times |
A positive |
n_samples |
A positive |
For playing routines, it can be useful to generate repeats of a sample loop.
This method returns the waveform of a PTSample where the
loop is repeated times`' times or has a length of n_samples''.
Returns a waveform represented by a numeric
vector of values ranging from 0 up to 255. Has a length of
n_samples when that argument is specified.
Pepijn de Vries
Other loop.methods:
loopLength(),
loopStart(),
loopState()
Other sample.operations:
PTSample-class,
PTSample-method,
fineTune(),
loopLength(),
loopStart(),
loopState(),
name,
playSample(),
read.sample(),
sampleLength(),
volume(),
waveform(),
write.sample()
data("mod.intro")
## Loop sample number 4 10 times:
wform <- loopSample(PTSample(mod.intro, 4), times = 10)
plot(wform, type = "l")
## Loop sample number 4, such that its
## final length is 5000 samples:
wform <- loopSample(PTSample(mod.intro, 4), n_samples = 5000)
plot(wform, type = "l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.