Skip to contents

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

Usage

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

# S4 method for 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.

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.

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.

Note

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

Author

Pepijn de Vries

Examples

if (FALSE) {
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)
}