read.module {ProTrackR} | R Documentation |
Read a ProTracker module file
Description
Reads a ProTracker module file and coerces it to a PTModule
object.
Usage
## S4 method for signature 'character,logical'
read.module(file, ignore.validity = F)
## S4 method for signature 'ANY,missing'
read.module(file, ignore.validity = F)
## S4 method for signature 'ANY,missing'
read.module(file, ignore.validity = F)
## S4 method for signature 'ANY,logical'
read.module(file, ignore.validity = F)
Arguments
file |
either a filename or a file connection, that
allows reading binary data (see e.g., |
ignore.validity |
A |
Details
The routine to read ProTracker modules is based on the referenced version of ProTracker 2.3A. This means that the routine may not be able to read files produced with later ProTracker versions, or earlier versions with back-compatibility issues. So far I've successfully tested this method on all modules I've composed with ProTracker version 2.3A (which I believe was one of the more popular versions of ProTracker back in the days).
It should also be able to read most of the .mod files in The Mod Archive.
Value
Returns a PTModule
object read from the provided ProTracker file
Author(s)
Pepijn de Vries
References
https://wiki.multimedia.cx/index.php?title=Protracker_Module
See Also
Other io.operations:
read.sample()
,
write.module()
,
write.sample()
Other module.operations:
PTModule-class
,
appendPattern()
,
clearSamples()
,
clearSong()
,
deletePattern()
,
fix.PTModule()
,
modToWave()
,
moduleSize()
,
patternLength()
,
patternOrderLength()
,
patternOrder()
,
playMod()
,
playingtable()
,
rawToPTModule()
,
trackerFlag()
,
write.module()
Examples
## Not run:
## first create an module file from example data:
data("mod.intro")
write.module(mod.intro, "intro.mod")
## read the module:
mod <- read.module("intro.mod")
## or create a connection yourself:
con <- file("intro.mod", "rb")
## note that you can also read from URL connections!
mod2 <- read.module(con)
## don't forget to close the file:
close(con)
## End(Not run)