fix.PTModule {ProTrackR}R Documentation

Attempt to fix PTModule to ProTracker specs

Description

Try to fix non-valid PTModule objects in order to meet with ProTracker specs such that they pass validity tests.

Usage

## S4 method for signature 'PTModule,logical'
fix.PTModule(mod, verbose = T)

## S4 method for signature 'PTModule,missing'
fix.PTModule(mod)

Arguments

mod

A PTModule object which needs fixing.

verbose

With the default value of TRUE, the method prints a progress report to the sink. When set to FALSE, the progress report is suppressed.

Details

Almost any file can be read as a PTModule object (using read.module) when validity is ignored and no unexpected end of file is reached. This package's object validity are very strickly testing for compliance with ProTracker specifications. As many modules could have been created with other trackers (which often will play just as well in ProTracker) it is desirable to convert such object to ProTracker specs. This method attempts to do so, by fixing each aspect, that is also tested in the object validity functions. Note that the attempts are no guarantee for success, and ‘fixed’ modules may not play as intended.

Value

Returns a copy of object mod in which all non-conformaties are attempted to be fixed. (Attempted) fixes are listed printed in the progress report.

Note

In the current version, pattern data itself is not checked for non-conformaties nor is it fixed.

Author(s)

Pepijn de Vries

See Also

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

Examples

## Not run: 
data("mod.intro")

## Let's do something illegal and destroy mod.intro:
mod.intro@pattern.order <- mod.intro@pattern.order[1:9]

## We should have used the 'patternOrder'-method to
## change the pattern order. Now we have broken the
## object:
validObject(mod.intro, TRUE)

## No worries, we can fix it:
mod.intro <- fix.PTModule(mod.intro)

## See, it's all OK again:
validObject(mod.intro, TRUE)

## End(Not run)

[Package ProTrackR version 0.4.3 Index]