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.
Features
- Comprehensive Plugin Support: Access to 100+ Vamp plugins for audio analysis
- Data Frame Output: Results returned as a list of R data frames for easy analysis and visualization
Installation
Install R Package
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")Quick Start
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")Common Use Cases
Package Information
# 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)Audio Data Flow
-
Input:
tuneR::WaveS4 objects from R - Conversion: Extracted to float buffers in C++
- Processing: Fed block-by-block to Vamp plugins with automatic adaptation
- Output: Collected in memory and returned as a list of DataFrames to R
References
- Vamp Plugins: https://www.vamp-plugins.org/
- Cannam, C., Landone, C., & Sandler, M. (2010). Sonic Visualiser: An open source application for viewing, analysing, and annotating music audio files. Proceedings of the 18th ACM International Conference on Multimedia, 1467-1468.
Author
Ed Baker ed@ebaker.me.uk
