if (FALSE) {
library(tuneR)
# Load audio file
audio <- readWave("myaudio.wav")
# Run amplitude follower plugin - returns list with one output
result <- runPlugin(
wave = audio,
key = "vamp-example-plugins:amplitudefollower"
)
# Access the amplitude output
amplitude_data <- result$amplitude
head(amplitude_data)
# Run onset detection - may return multiple outputs
result <- runPlugin(
wave = audio,
key = "vamp-aubio-plugins:aubioonset"
)
# See what outputs were produced
names(result)
# Access specific outputs
onsets <- result$onsets
detection_fn <- result$detection_function
# Run plugin with custom parameters
# First check what parameters are available
params_info <- vampPluginParams("vamp-aubio-plugins:aubioonset")
print(params_info)
# Set specific parameter values
result <- runPlugin(
wave = audio,
key = "vamp-aubio-plugins:aubioonset",
params = list(threshold = 0.5, silence = -70)
)
# Run with custom block and step sizes for better time resolution
result <- runPlugin(
wave = audio,
key = "vamp-aubio-plugins:aubioonset",
blockSize = 512, # Smaller blocks for better time resolution
stepSize = 128 # 75% overlap for smoother detection
)
# Run frequency domain plugin with larger FFT for better frequency resolution
result <- runPlugin(
wave = audio,
key = "qm-vamp-plugins:qm-chromagram",
blockSize = 4096, # Larger FFT for better frequency resolution
stepSize = 2048 # 50% overlap (typical for frequency domain)
)
}
Run the code above in your browser using DataLab