Learn R Programming

ProTrackR (version 0.4.4)

write.module: Export an PTModule object as a ProTracker module file

Description

Export an PTModule object as a ProTracker module file, conform ProTracker 2.3A specifications.

Usage

# S4 method for PTModule,ANY
write.module(mod, file)

# S4 method for PTModule,character write.module(mod, file)

Value

Writes to a module file but returns nothing.

Arguments

mod

A valid PTModule object to be saved as a ProTracker *.mod file

file

either a filename to write to, or a file connection, that allows to write binary data (see base::file).

Author

Pepijn de Vries

Details

The routine to write ProTracker modules is based on the referenced version of ProTracker 2.3A. This means that the routine may not be able to write files that ar compatible with later or earlier ProTracker versions.

References

https://wiki.multimedia.cx/index.php?title=Protracker_Module

See Also

Other io.operations: read.module(), read.sample(), write.sample()

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

Examples

Run this code
## get the PTModule object provided with the ProTrackR package
data("mod.intro")

f <- tempfile(fileext = ".mod")
## save the object as a valid ProTracker module file:
write.module(mod.intro, f)

## or create the connection yourself:
con <- file(f, "wb")
write.module(mod.intro, con)

## don't forget to close the connection after you're done:
close(con)

Run the code above in your browser using DataLab