From 5ff4572d67b270ccb5540537fc7b0579ac197e59 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Sun, 21 Jan 2024 12:23:39 +0000 Subject: [PATCH] Expose Vamp* classes only when available --- source/src/python/nodes.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/src/python/nodes.cpp b/source/src/python/nodes.cpp index b0710c1a..1c782945 100644 --- a/source/src/python/nodes.cpp +++ b/source/src/python/nodes.cpp @@ -25,9 +25,13 @@ void init_python_nodes(py::module &m) py::class_>(m, "OnsetDetector", "Simple time-domain onset detector. Outputs an impulse when an onset is detected in the input. Maintains short-time and long-time averages. An onset is registered when the short-time average is threshold x the long-time average. min_interval is the minimum interval between onsets, in seconds.") .def(py::init(), "input"_a = 0.0, "threshold"_a = 2.0, "min_interval"_a = 0.1); +#ifdef HAVE_VAMP + py::class_>(m, "VampAnalysis", "Feature extraction using the Vamp plugin toolkit.") .def(py::init(), "input"_a = 0.0, "plugin_id"_a = "vamp-example-plugins:spectralcentroid:linearcentroid"); +#endif + py::class_>(m, "BeatCutter", "Cuts a buffer into segment_count segments, and stutters/jumps with the given probabilities.") .def(py::init(), "buffer"_a = nullptr, "segment_count"_a = 8, "stutter_probability"_a = 0.0, "stutter_count"_a = 1, "jump_probability"_a = 0.0, "duty_cycle"_a = 1.0, "rate"_a = 1.0, "segment_rate"_a = 1.0);