Last active
February 6, 2019 13:45
-
-
Save pepijn-devries/90f057f89f48661b7c52 to your computer and use it in GitHub Desktop.
Download and play a ProTracker module in R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment