summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-09-06 00:40:22 +0100
committerComment <tim@gray.(none)>2013-09-06 00:40:22 +0100
commit79073900bbe69e9dd9cfe1ed74470e4e2c93918f (patch)
treea181f7830a1f6c0495bacd70598fe13385720309
parent8992cb1d0d07edc33d274f6d7924ecdf6f83d994 (diff)
making act segmenter
-rw-r--r--rotord/src/nodes_audio_analysis.h27
1 files changed, 25 insertions, 2 deletions
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 <string,float> params;
};
class Audio_analysis: public Vamp_node {
@@ -95,9 +96,31 @@ namespace Rotor {
Act_segmenter* clone(map<string,string> &_settings) { return new Act_segmenter(_settings);};
void cleanup(){
Vamp_node::cleanup();
- cerr<<"act segmenter custom cleanup"<<endl;
+ //cerr<<"act segmenter custom cleanup"<<endl;
+ vector<float> durations;
+ for (map<double,vampHost::feature>::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<double,int> acts;
};
}