Saturday, 7 November 2015

ProTrackR: chiptunes in R (part two)

A short follow-up on my previous post. I have just released a new version of the ProTrackR package (available on the CRAN). It can now actually play ProTracker modules, yeah! The routine isn't perfect yet but it does a decent job at the moment. The example below shows how you can download a module from ModArchive and play it:
# load the required packages
require(ProTrackR)
# set up a connection to 'cyberrid.mod':
con <- url("http://api.modarchive.org/downloads.php?moduleid=40293", "rb")
# download module:
mod <- read.module(con)
close(con)
rm(con)
# and play it:
mod.wave <- playMod(mod,
max.duration = 300,
target.rate = 22050)
# plot the waveform:
plot(mod.wave)

No comments:

Post a Comment