Renders a ProTracker module as audio::audioSample()
and plays it.
Usage
# S3 method for class 'pt2mod'
play(x, duration = NA, options = pt2_render_options(), position = 0L, ...)
Arguments
- x
Object to be played.
- duration
Duration of the rendered output in seconds. When set to
NA
the duration of the module is calculated and used for rendering.- options
A list of options used for rendering the audio. Use
pt2_render_options()
to obtain default options, or modify them.- position
Starting position in the pattern sequence table (
pt2_pattern_table()
). Should be a non negative value smaller than the mule length (pt2_length()
).- ...
Arguments passed to
pt2_render()
.
Value
Returns an [audio::
$.audioInstance]
object which
allows you to control the playback (pause, resume, rewind).
Examples
if (FALSE) { # \dontrun{
mod <- pt2_read_mod(pt2_demo())
## ctrl will contain the audioInstance that will let you control the audio playback:
ctrl <- play(mod)
} # }