From 79073900bbe69e9dd9cfe1ed74470e4e2c93918f Mon Sep 17 00:00:00 2001 From: Comment Date: Fri, 6 Sep 2013 00:40:22 +0100 Subject: making act segmenter --- rotord/src/nodes_audio_analysis.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'rotord/src') diff --git a/rotord/src/nodes_audio_analysis.h b/rotord/src/nodes_audio_analysis.h index ee98c3b..8fb843c 100644 --- a/rotord/src/nodes_audio_analysis.h +++ b/rotord/src/nodes_audio_analysis.h @@ -50,8 +50,9 @@ namespace Rotor { protected: string soname,id; int outputNo; - private: vampHost::Analyser analyser; + private: + //?? map params; }; class Audio_analysis: public Vamp_node { @@ -95,9 +96,31 @@ namespace Rotor { Act_segmenter* clone(map &_settings) { return new Act_segmenter(_settings);}; void cleanup(){ Vamp_node::cleanup(); - cerr<<"act segmenter custom cleanup"< durations; + for (map::iterator f=analyser.features.begin();f!=analyser.features.end();++f){ + auto g=f; + if (++g!=analyser.features.end()){ + durations.push_back(g->first-f->first); + } + } + + + //distribute acts amongst segments; + if (analyser.features.size()==(int)parameters["acts"]->value+1){ + for (auto f: analyser.features){ + acts[f.first]=f.second.number; + } + } + else if (analyser.features.size()<(int)parameters["acts"]->value+1){ + //find longest segment + } + else { //extra segments to distribute + + } } private: + map acts; }; } -- cgit v1.2.3