rawToPTModule {ProTrackR}R 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 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 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 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)

[Package ProTrackR version 0.4.3 Index]