From 502a92835949c5da869e1748790e6e090b9c4f94 Mon Sep 17 00:00:00 2001 From: Comment Date: Tue, 10 Dec 2013 01:50:19 +0000 Subject: branch rollback --- rotord/src/nodes_audio_analysis.cpp | 72 ++----------------------------------- 1 file changed, 2 insertions(+), 70 deletions(-) (limited to 'rotord/src') diff --git a/rotord/src/nodes_audio_analysis.cpp b/rotord/src/nodes_audio_analysis.cpp index f077d41..2a39d8c 100644 --- a/rotord/src/nodes_audio_analysis.cpp +++ b/rotord/src/nodes_audio_analysis.cpp @@ -122,7 +122,7 @@ namespace Rotor{ //how to group with similarity? //segments come with similarity groups - // 1 - are the wanted segments less than discovered? + // 1 - are the wanted git checksegments less than discovered? // N - do nothing // 2 - get intensity and tempo averages // 2 - count the groups @@ -218,7 +218,7 @@ namespace Rotor{ totalsmap.push_back((tempos[i]*parameters["tempo_weight"]->value)+(intensities[i]*parameters["intensity_weight"]->value)); } - /* + //sort and convert to features std::sort(totals.begin(),totals.end(),sortsegments); for (i=0;i> -start grouping by similarity -if there are more similarity groups than wantedgroups, start by grouping similarities -otherwise take biggest similarity groups and split them by intensity -if there are still too many groups, merge closest smallest groups -finally sort by intensity to map output - -nned to retrieve total intensity by segment - */ - // segment group_intensity seg_intense segment - vector > > > seggrps; - for (i=0;i > data; - data.push_back(make_pair(totalsmap[i],i)); - seggrps.push_back(make_pair(totalsmap[i],data)); - } - for (auto s:similarities){ - if (s.second.size()>1){ - for (int j=s.second.size()-1;j>0;j--){ - seggrps[s.second[0]].second.push_back(make_pair(totalsmap[s.second[j]],s.second[j])); - //keep running average// should be by area? - seggrps[s.second[0]].first+=(totalsmap[s.second[j]]*(1.0/max(1,(int)seggrps[s.second[0]].second.size()-1))); - double div=seggrps[s.second[0]].second.size()==1?1.0:((double)seggrps[s.second[0]].second.size()-1/(double)seggrps[s.second[0]].second.size()); - //neat! this gives 1,1/2,2/3,3/4.. - seggrps[s.second[0]].first*=div; - seggrps.erase(seggrps.begin()+s.second[j]); - } - } - } - cerr<<"similarities assigned, "<<(totalsmap.size()-seggrps.size())<<" segments merged"<(int)parameters["levels"]->value){ - //reduce similarity groups - //decide the best 2 to merge - vector diffs; - for (int j=0;jvalue) { - //split groups - } - - map outputvalues; - for (int j=0;j