ReVAMP provides an R interface to the Vamp audio analysis plugin system developed by Queen Mary University of London's Centre for Digital Music. It enables R users to load and run Vamp plugins for tasks like tempo detection, onset detection, spectral analysis, and feature extraction.
Install from CRAN:
install.packages("ReVAMP")
Install from source:
# Install dependencies
install.packages(c("Rcpp", "tuneR"))
# Install ReVAMP
install.packages("path/to/ReVAMP_1.0.tar.gz", repos = NULL, type = "source")
Or install with devtools:
# devtools::install_github("edwbaker/ReVAMP")
install.packages("ReVAMP", repos = c('https://edwbaker.r-universe.dev', 'https://cloud.r-project.org'))
ReVAMP requires external Vamp plugins to be installed.
library(ReVAMP)
library(tuneR)
# Load audio file
audio <- readWave("myaudio.wav")
# Run amplitude follower and get results as data frame
result <- runPlugin(
wave = audio,
key = "vamp-example-plugins:amplitudefollower",
useFrames = FALSE # Use timestamps in seconds
)
# Examine results
str(result)
#> List of 1
#> $ amplitude:'data.frame': 1292 obs. of 4 variables:
#> ..$ timestamp: num [1:1292] 0 0.023 0.046 0.07 0.093 ...
#> ..$ duration : num [1:1292] NA NA NA NA NA ...
#> ..$ value : num [1:1292] 22866 22896 22735 22531 22380 ...
#> ..$ label : chr [1:1292] "" "" "" "" ...
# Plot amplitude over time
plot(result$amplitude$timestamp, result$amplitude$value, type = "l",
xlab = "Time (s)", ylab = "Amplitude",
main = "Audio Amplitude")
# Get Vamp API/SDK version info
vampInfo()
# List plugin search paths
vampPaths()
# List all installed plugins with details
plugins <- vampPlugins()
View(plugins)
# Get parameters for a specific plugin
params <- vampPluginParams("vamp-aubio-plugins:aubioonset")
View(params)
tuneR::Wave S4 objects from RThe package uses standard R/Rcpp development tools:
library(devtools)
# Make changes to code...
# Regenerate documentation
roxygen2::roxygenise()
# Install locally
install()
# Run tests
test()
# Run R CMD check
check()
GPL (>= 2)
Ed Baker ed@ebaker.me.uk{.email}