summaryrefslogtreecommitdiff
path: root/rotord/rotor.h
diff options
context:
space:
mode:
authorTim Redfern <tim@herge.(none)>2013-04-10 13:49:24 +0100
committerTim Redfern <tim@herge.(none)>2013-04-10 13:49:24 +0100
commit6275e8f15b63f85c2206f0acb64023610c711f24 (patch)
tree6074c92614c7d86b4bbfb33ec52737456f34bd1e /rotord/rotor.h
parent79b312df05887fb6c9dbfa56bb78bbb6f06a1a3d (diff)
signal rendering path nearly there
Diffstat (limited to 'rotord/rotor.h')
-rwxr-xr-xrotord/rotor.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/rotord/rotor.h b/rotord/rotor.h
index 105ed98..7dbb18d 100755
--- a/rotord/rotor.h
+++ b/rotord/rotor.h
@@ -244,9 +244,21 @@ namespace Rotor {
void cleanup();
int process_frame(uint8_t *data,int samples_in_frame);
float get_output(const float &time) {
- float t=time;
- return t;
+ if (analyser.features.size()) {
+ auto i=analyser.features.lower_bound(time);
+ if (i!=analyser.features.end()){
+ float lk=i->first;
+ int ln=i->second;
+ if (i++!=analyser.features.end()){
+ float uk=i->first;
+ return (((time-lk)/(uk-lk))+ln);
+ }
+ else return (float)ln;
+ }
+ }
+ return 0.0f;
}
+ void print_features();
private:
string soname,id;
int outputNo;