summaryrefslogtreecommitdiff
path: root/rotord/src/nodes_audio_analysis.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/nodes_audio_analysis.h')
-rw-r--r--rotord/src/nodes_audio_analysis.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/rotord/src/nodes_audio_analysis.h b/rotord/src/nodes_audio_analysis.h
index 619b60a..d192d26 100644
--- a/rotord/src/nodes_audio_analysis.h
+++ b/rotord/src/nodes_audio_analysis.h
@@ -36,7 +36,7 @@ namespace Rotor {
void set_parameter(const std::string &key,const std::string &value){params[key]=ofToFloat(value);};
int process_frame(uint8_t *data,int samples_in_frame);
const float output(const Time_spec &time) {
- if (analyser.features.size()) {
+ if (analyser.features.size()) {
auto i=analyser.features.upper_bound(time.time); //the first element in the container whose key is considered to go after k
if (i!=analyser.features.end()){
float uk=i->first;
@@ -45,15 +45,17 @@ namespace Rotor {
if (i->second.values.size()) v2=i->second.values[0];
i--;
float lk=i->first;
- int ln=i->second.number;
+ int ln=i->second.number-1; //vamp numbers the first segment 0
if (i->second.values.size()) v1=i->second.values[0];
+ int m=attributes["mode"]->intVal;
+ //
switch (attributes["mode"]->intVal){
case VAMPHOST_Timeline:
- return ((time.time-lk)+ln);
+ return (((time.time-lk)/(uk-lk))+ln);
case VAMPHOST_Timesteps:
return (float)ln;
case VAMPHOST_Valueline:
- return (((time.time-lk)*(v2-v1))+v1);
+ return ((((time.time-lk)/(uk-lk))*(v2-v1))+v1);
case VAMPHOST_Values:
return v1;
}
@@ -73,4 +75,4 @@ namespace Rotor {
};
}
-#endif \ No newline at end of file
+#endif