play: Play a ProTracker module

playR Documentation

Play a ProTracker module

Description

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).

Author(s)

Pepijn de Vries

Examples

## Not run: 
mod <- pt2_read_mod(pt2_demo())

## ctrl will contain the audioInstance that will let you control the audio playback:
ctrl <- play(mod)

## End(Not run)

ProTrackR2 documentation built on April 3, 2025, 9:21 p.m.