From 6a9e9a8f44ca5b9996acd239ddb16ee4f00f00d5 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 21 Nov 2013 16:10:21 +0000 Subject: intensity segmenter level redistribution --- rotord/src/nodes_audio_analysis.h | 1 + 1 file changed, 1 insertion(+) (limited to 'rotord/src/nodes_audio_analysis.h') diff --git a/rotord/src/nodes_audio_analysis.h b/rotord/src/nodes_audio_analysis.h index 5b0a9c8..21da1cc 100644 --- a/rotord/src/nodes_audio_analysis.h +++ b/rotord/src/nodes_audio_analysis.h @@ -288,6 +288,7 @@ namespace Rotor { analysers["intensity"]=vampHost::Analyser(); create_parameter("intensity_weight","number","intensity weight","Intensity weighting",1.0f); create_parameter("tempo_weight","number","tempo weight","Tempo weighting",1.0f); + create_parameter("levels","number","levels","Number of intensity levels",0.0f); }; Intensity_segmenter(map &settings):Intensity_segmenter() { base_settings(settings); -- cgit v1.2.3 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 +++++++---- rotord/src/nodes_audio_analysis.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'rotord/src/nodes_audio_analysis.h') 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 "< &_settings) { return new Intensity_segmenter(_settings);}; bool init(int _channels,int _bits,int _samples,int _rate) { + features.clear(); return 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["intensity"].init("bbc-vamp-plugins","bbc-intensity",_channels,_bits,_samples,_rate,0,params); -- cgit v1.2.3