rawToPTModule: Convert a vector of raw data into a PTModule object

rawToPTModuleR Documentation

Convert a vector of raw data into a PTModule object

Description

This method treats a vector of raw data as if it where a file, and converts it into a PTModule-class object.

Usage

## S4 method for signature 'raw'
rawToPTModule(x, ignore.validity = F)

Arguments

x

A vector of raw data, conform ProTracker file specs.

ignore.validity

A logical value. When set as TRUE this method will attempt to decode the raw data (x), even when it is invalid. When set to FALSE (default) validity is checked and an error is thrown when invalidity occurs.

Details

Data is read from a vector of raw data as if it where a file and converted into a PTModule-class object. This method can be useful for module files stored on virtual Amiga Disk Files (adf), which can be read as raw data, using the AmigaFFH package.

Use as.raw to achieve the inverse.

Value

returns a PTModule-class object.

Author(s)

Pepijn de Vries

See Also

Other module.operations: PTModule-class, appendPattern(), clearSamples(), clearSong(), deletePattern(), fix.PTModule(), modToWave(), moduleSize(), patternLength(), patternOrderLength(), patternOrder(), playMod(), playingtable(), read.module(), trackerFlag(), write.module()

Other raw.operations: as.raw(), nybbleToSignedInt(), nybble(), rawToCharNull(), rawToSignedInt(), rawToUnsignedInt(), signedIntToNybble(), signedIntToRaw(), unsignedIntToRaw()

Examples

## Not run: 
## convert the example mod into raw data
data("mod.intro")
mod.raw <- as.raw(mod.intro)

## restore it as a PTModule-class object
mod.restored <- rawToPTModule(mod.raw)

## In this case the result is identical to the original:
identical(mod.restored, mod.intro)

## End(Not run)

ProTrackR documentation built on Aug. 23, 2023, 1:07 a.m.