From 49319bd72f888046ecafa7bf236ad8d7525d4096 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 22 Nov 2013 15:19:51 +0000 Subject: intensity segmenter update --- rotord/src/nodes_audio_analysis.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'rotord/src/nodes_audio_analysis.cpp') diff --git a/rotord/src/nodes_audio_analysis.cpp b/rotord/src/nodes_audio_analysis.cpp index 5770fb2..9ad33f6 100644 --- a/rotord/src/nodes_audio_analysis.cpp +++ b/rotord/src/nodes_audio_analysis.cpp @@ -69,6 +69,7 @@ namespace Rotor{ bits=_bits; samples=_samples; + features.clear(); return analyser.init(soname,id,_channels,_bits,_samples,_rate,outputNo,params); @@ -167,7 +168,6 @@ namespace Rotor{ if (intensity>max_intensity) max_intensity=intensity; if (intensity> totals; @@ -178,19 +178,22 @@ namespace Rotor{ } //sort and convert to features std::sort(totals.begin(),totals.end(),sortsegments); + for (i=0;i bucketoffsets; for (auto t:totals) bucketoffsets.push_back(0.0f); if (parameters["levels"]->value>0.0f&¶meters["levels"]->valuevalue-2); + int numbertoredistribute=totals.size()-((int)parameters["levels"]->value); float numberperbin=((float)numbertoredistribute/totals.size()); - float toadd=0.0f; + float toadd=0.5f; int added=0; for (int j=0;j0) { cerr<<"reducing number of levels by "<