From 8864f5da9649c176e472a7fb8913dd8114deec54 Mon Sep 17 00:00:00 2001 From: Comment Date: Mon, 28 Oct 2013 23:01:39 +0000 Subject: making intensity segmenter --- rotord/src/nodes_audio_analysis.h | 42 ++++++++++++++++++++++++++++++++++++++- rotord/src/rotor.cpp | 1 + 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/rotord/src/nodes_audio_analysis.h b/rotord/src/nodes_audio_analysis.h index 44ea3eb..db33b1f 100644 --- a/rotord/src/nodes_audio_analysis.h +++ b/rotord/src/nodes_audio_analysis.h @@ -78,9 +78,9 @@ namespace Rotor { string soname,id; int outputNo; vampHost::Analyser analyser; + map params; private: //?? - map params; }; class Audio_analysis: public Vamp_node { //vamp node that allows the user to choose a plugin @@ -266,6 +266,46 @@ namespace Rotor { private: }; + class Intensity_segmenter: public Vamp_node { + //vamp node that applies a ruleset to manage a set of acts via a cycler + public: + Intensity_segmenter(){ + title="Intensity segmenter"; + description="Combines segmentation, tempo and intensity"; + UID="74e05d10-3ffa-11e3-b5f9-7335309da36a"; + analysers["segmenter"]=vampHost::Analyser(); + analysers["tempo"]=vampHost::Analyser(); + analysers["intensity"]=vampHost::Analyser(); + }; + Intensity_segmenter(map &settings):Intensity_segmenter() { + base_settings(settings); + }; + ~Intensity_segmenter(){}; + Intensity_segmenter* clone(map &_settings) { return new Intensity_segmenter(_settings);}; + bool init(int _channels,int _bits,int _samples, int _rate) { + //params needed? + analysers["segmenter"].init("qm-vamp-plugins","qm-segmenter",_channels,_bits,_samples,_rate,0,params); + analysers["tempo"].init("qm-vamp-plugins","qm-tempotracker",_channels,_bits,_samples,_rate,2,params); + analysers["tempo"].init("bbc-vamp-plugins","bbc-intensity",_channels,_bits,_samples,_rate,0,params); + return true; + } + int process_frame(uint8_t *data,int samples_in_frame) { + for (auto a:analysers) a.second.process_frame(data,samples_in_frame); + return 1; + } + void cleanup() { + for (auto a:analysers) a.second.cleanup(); + + for (auto f:analysers["segmenter"].features){ + + } + //add last item back on + //acts[(*--analyser.features.end()).first]=analyser.features[(*--analyser.features.end()).first]; + //analyser.features=acts; + } + private: + map analysers; + }; } #endif diff --git a/rotord/src/rotor.cpp b/rotord/src/rotor.cpp index d3a5486..88284c9 100644 --- a/rotord/src/rotor.cpp +++ b/rotord/src/rotor.cpp @@ -59,6 +59,7 @@ Node_factory::Node_factory(){ category["audio"]=vector(); add_type("audio_analysis",new Audio_analysis(),category["audio"]); add_type("audio_analysis2",new Audio_analysis2(),category["audio"]); + add_type("intensity_segmenter",new Intensity_segmenter(),category["audio"]); category["maths"]=vector(); add_type("comparison",new Comparison(),category["maths"]); //TODO: alias to symbols -- cgit v1.2.3