Skip to contents

Returns the original numeric channels decoded from the recording. These values are retained in every representation mode. No cross-platform normalisation is applied: M64 sticks use signed -128..127 values; PXM/PJM sticks and DTM sticks/triggers use unsigned 0..255 values; BK2 keeps its logged numeric values, including sensors and paddles. Columns are named by key, so that the X axis of the left stick is left_x in every format; channel_layout() lists the keys beside the labels of the recording. Doom-engine channels are the signed movement and turning commands of each tic, not physical device events. See the format-specific reader for interpretation.

Usage

analog_channels(movie, idx = 1L)

Arguments

movie

A replayr_movie or replayr_poll_stream returned by read_movie() or a format-specific reader.

idx

Player index, 1-based. Defaults to 1 (player 1).

Value

Numeric matrix with one row per observation and one column per channel, named by the keys of channel_layout(); zero columns for a player with no analogue channels.

Details

For an unassigned replayr_poll_stream, idx = 1 selects the single stored stream.

An absent analogue channel has no column. A missing BK2 numeric sample is NA, rather than an invented neutral value. Row order matches player().

Examples

path <- system.file("extdata", "sample.m64", package = "replayr")
movie <- read_movie(path)
head(analog_channels(movie))
#>      left_x left_y
#> [1,]     70      0
#> [2,]     70      2
#> [3,]     70      4
#> [4,]     70      5
#> [5,]     70      7
#> [6,]     69      9
projected <- read_movie(path, analog = "cardinal8")
identical(analog_channels(movie), analog_channels(projected))
#> [1] TRUE