diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-05-31 18:49:38 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-05-31 18:49:38 +0100 |
| commit | 31a9010253e555091992515c09760ff4118a224b (patch) | |
| tree | 2d71c2a823c6c55870e7a1ef0b278a5d62b5d9ee /gui/src/AudioPlotter.h | |
| parent | c28bf33277ef6a7d9ac901f76f6c0e5c4fcbc83d (diff) | |
add audioplotter source
Diffstat (limited to 'gui/src/AudioPlotter.h')
| -rw-r--r-- | gui/src/AudioPlotter.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gui/src/AudioPlotter.h b/gui/src/AudioPlotter.h new file mode 100644 index 0000000..a1495c3 --- /dev/null +++ b/gui/src/AudioPlotter.h @@ -0,0 +1,53 @@ +#include "ofMain.h" +#include "ofxAChaoslib.h" + +#include "lineTransformer.h" + +class Audioplotter{ + //store and draw a numbr of audio samples + //how best to handle transforms - maybe pass in a transform to be added to 2nd and subsequent + //how best to handle length of history data - fixed number that can be set, or line budget? +public: + Audioplotter(int _size=1,bool _joined=true,bool _bars=false,int _width=2){ + setup(_size,_joined,_bars,_width); + } + void setup(int _size=1,bool _joined=true,bool _bars=false,int _width=2){ + history_size=_size; + joined=_joined; + bars=_bars; + width=_width; + startColour=ofColor(255,255,255); + endColour=ofColor(0,0,0); + attractor.setup(); + } + colourPolyline compute_chaos(colourPolyline& poly,float colourFade=1.0f); + vector <colourPolyline> output(float scale=1.0f,float decay=-1.0f); + void addpoints(vector <float> &audio); + int numpoints(); + + ofParameter<bool> joined; + ofParameter<bool> bars; + ofParameter<int> width; + ofParameter<int> history_size; + ofParameter<int> num_points; + +//feedback transformation + ofParameter<ofVec2f> translate; + ofParameter<float> rotate; + ofParameter<ofVec2f> scale; + + ofParameter<ofColor> startColour; + ofParameter<ofColor> endColour; + + ofParameter<bool> usechaos; + ofParameter<float> chaosamount; + ofParameter<float> chaos_a; + ofParameter<float> chaos_b; + ofParameter<float> chaos_k; + ofParameter<float> chaos_p; + +private: + vector < vector<colourPolyline>> data; + AChaosIkeda attractor; + +};
\ No newline at end of file |
