diff options
Diffstat (limited to 'rotord/src')
| -rw-r--r-- | rotord/src/nodes_audio_analysis.h | 42 | ||||
| -rw-r--r-- | rotord/src/rotor.cpp | 1 |
2 files changed, 42 insertions, 1 deletions
diff --git a/rotord/src/nodes_audio_analysis.h b/rotord/src/nodes_audio_analysis.h index 44ea3eb..db33b1f 100644 --- a/rotord/src/nodes_audio_analysis.h +++ b/rotord/src/nodes_audio_analysis.h @@ -78,9 +78,9 @@ namespace Rotor { string soname,id; int outputNo; vampHost::Analyser analyser; + map <string,float> params; private: //?? - map <string,float> params; }; class Audio_analysis: public Vamp_node { //vamp node that allows the user to choose a plugin @@ -266,6 +266,46 @@ namespace Rotor { private: }; + class Intensity_segmenter: public Vamp_node { + //vamp node that applies a ruleset to manage a set of acts via a cycler + public: + Intensity_segmenter(){ + title="Intensity segmenter"; + description="Combines segmentation, tempo and intensity"; + UID="74e05d10-3ffa-11e3-b5f9-7335309da36a"; + analysers["segmenter"]=vampHost::Analyser(); + analysers["tempo"]=vampHost::Analyser(); + analysers["intensity"]=vampHost::Analyser(); + }; + Intensity_segmenter(map<string,string> &settings):Intensity_segmenter() { + base_settings(settings); + }; + ~Intensity_segmenter(){}; + Intensity_segmenter* clone(map<string,string> &_settings) { return new Intensity_segmenter(_settings);}; + bool init(int _channels,int _bits,int _samples, int _rate) { + //params needed? + 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["tempo"].init("bbc-vamp-plugins","bbc-intensity",_channels,_bits,_samples,_rate,0,params); + return true; + } + int process_frame(uint8_t *data,int samples_in_frame) { + for (auto a:analysers) a.second.process_frame(data,samples_in_frame); + return 1; + } + void cleanup() { + for (auto a:analysers) a.second.cleanup(); + + for (auto f:analysers["segmenter"].features){ + + } + //add last item back on + //acts[(*--analyser.features.end()).first]=analyser.features[(*--analyser.features.end()).first]; + //analyser.features=acts; + } + private: + map<string,vampHost::Analyser> analysers; + }; } #endif diff --git a/rotord/src/rotor.cpp b/rotord/src/rotor.cpp index d3a5486..88284c9 100644 --- a/rotord/src/rotor.cpp +++ b/rotord/src/rotor.cpp @@ -59,6 +59,7 @@ Node_factory::Node_factory(){ category["audio"]=vector<Node*>(); add_type("audio_analysis",new Audio_analysis(),category["audio"]); add_type("audio_analysis2",new Audio_analysis2(),category["audio"]); + add_type("intensity_segmenter",new Intensity_segmenter(),category["audio"]); category["maths"]=vector<Node*>(); add_type("comparison",new Comparison(),category["maths"]); //TODO: alias to symbols |
