playSample {ProTrackR} | R Documentation |
Play audio samples
Description
Method to play PTSample
s or all such samples from
PTModule
objects as audio.
Usage
## S4 method for signature 'PTSample'
playSample(x, silence = 0, wait = T, note = "C-3", loop = 1, ...)
## S4 method for signature 'PTModule'
playSample(x, silence = 0, wait = T, note = "C-3", loop = 1, ...)
Arguments
x |
Either a |
silence |
Especially for short samples, the |
wait |
A |
note |
A |
loop |
A positive |
... |
Further arguments passed on to |
Details
This method plays PTSample
s and such samples from
PTModule
objects, using the audio::play
method
from the audio package. Default fineTune
and volume
as specified for the PTSample
will be applied when playing
the sample.
Value
Returns nothing but plays the sample(s) as audio.
Author(s)
Pepijn de Vries
See Also
Other sample.operations:
PTSample-class
,
PTSample-method
,
fineTune()
,
loopLength()
,
loopSample()
,
loopStart()
,
loopState()
,
name
,
read.sample()
,
sampleLength()
,
volume()
,
waveform()
,
write.sample()
Other sample.rate.operations:
sampleRate
Other play.audio.routines:
playMod()
,
playWave()
Examples
## Not run:
data("mod.intro")
## play all samples in mod.intro:
playSample(mod.intro, 0.2, loop = 0.5)
## play a chromatic scale using sample number 3:
for (note in c("A-2", "A#2", "B-2", "C-3", "C#3",
"D-3", "D#3", "E-3", "F-3", "F#3",
"G-3", "G#3"))
{
playSample(PTSample(mod.intro, 3), note = note, silence = 0.05, loop = 0.4)
}
## play the sample at a rate based on a specific
## video mode and finetune:
playSample(PTSample(mod.intro, 3), video = "NTSC", finetune = -5)
## End(Not run)