Skip to contents

This method generates a table (data.frame) in which information from the pattern tables are put in the right order and in a comprehensive format.

Usage

# S4 method for PTModule
playingtable(
  mod,
  starting.position = 1,
  max.duration = 2 * 60,
  speed = 6,
  tempo = 125,
  video = c("PAL", "NTSC"),
  play.once = T,
  verbose = T
)

Arguments

mod

An object of class PTModule.

starting.position

A numeric starting position index. Determines where in the patternOrder table of the module to start generating the playingtable.

max.duration

A numeric value indicating the maximum length in seconds of the pattern information returned. By default set to 120 seconds (2 minutes). As some modules can be very long, or contain infinite loops or position jumps, the maximum duration is required to break out of the routine for generating the table.

speed

Default speed to use when it is not specified in the pattern data. See ProTrackR documentation for more info on speed' and tempo'.

tempo

Default tempo to use when it is not specified in the pattern data. See ProTrackR documentation for more info on speed' and tempo'.

video

The video mode of a Commodore Amiga affects timing routines. This mode can be specified with this argument and is represented by a character string that can have either the value 'PAL' or 'NTSC'. PAL is used by default.

play.once

A logical value. When set to TRUE, the routine will stop adding data to the table when the starting position (starting.position) is reach once again. Warning: may not work correctly when the last pattern contains a pattern break. Will be overruled when the maximum.duration is reached before the end of the song.

verbose

A logical value. Suppresses a progress report from being printed to the base::sink when set to FALSE. The default value is TRUE.

Value

Returns a data.frame with pattern rows put in the right order. Information contained in the returned table is described in the 'Details' section

Details

This method generates a table (data.frame) in which information from the pattern tables (PTPattern) are put in the right order, taking into account pattern breaks, position jumps and pattern loops (see also ProTrackR documentation, section on effect commands). The information is put in a comprehensive format in a data.frame, with the following columns:

row

Row number index of the original PTPattern object.

filter

A logical value indicating whether the Amiga hardware audio filter was either turned on or off using effect command E00/E01 (see also ProTrackR documentation, section on effect commands).

speed

Number of 'ticks' per row as set with the Fxy effect commands in the module.

tempo

The tempo as specified by the Fxy commands in the module.

delay

The delay that should be applied to the row as specified with the EEx effect command in the module.

effect.track1..4

The effect code (raw) as specified in each of the 4 tracks in the module.

effect.mag.track1..4

The effect magnitude (raw) as specified for each of the 4 tracks in the module.

sample.nr.track1..4

The sample index number (numeric) as specified for each of the 4 tracks in the module.

note.track1..4

The note (factor) as specified for each of the four tracks in the module.

position

The positions index number (numeric) from the patternOrder table in the module.

duration

Playback duration of the corresponding row in seconds.

cum_duration

Cumulative playback duration of the corresponding row in seconds.

Author

Pepijn de Vries

Examples

if (FALSE) {
data(mod.intro)
pt <- playingtable(mod.intro)
}