#include "Audioplotter.h" colourPolyline Audioplotter::compute_chaos(colourPolyline& poly,float colourFade){ colourPolyline tempPoly; for (int i=0;i"<<((poly[i].x-(ofGetWidth()/2))/chaosscale)<<" "<"<<((poly[i].y-(ofGetHeight()/2))/chaosscale)<<" "< Audioplotter::output(float plotscale,float plotdecay){ ofMatrix4x4 x = ofMatrix4x4::newIdentityMatrix(); x.translate((-ofGetWidth()/2)+((ofVec2f)translate).x,(-ofGetHeight()/2)+((ofVec2f)translate).y,0); x.rotate(rotate,0,0,1); x.scale(((ofVec2f)scale).x,((ofVec2f)scale).y,1.0f); x.translate((ofGetWidth()/2),(ofGetHeight()/2),0); ofMatrix4x4 flip = ofMatrix4x4::newIdentityMatrix(); flip.translate((-ofGetWidth()/2),(-ofGetHeight()/2),0); flip.scale(-1.0f,1.0f,1.0f); flip.translate((ofGetWidth()/2),(ofGetHeight()/2),0); //destructive or non? float fadefactor=plotdecay<0.0f?1.0f-(1.0f/history_size):plotdecay; vector outdata; for (int i=0;i newdata; for (int j=0;j &audio){ int num=min((int)num_points,(int)audio.size()); float step=((float)audio.size())/(num+1); vector newdata; if (joined){ colourPolyline line; if (bars){ for (int i=0;ihistory_size) { data.pop_back(); } } void Audioplotter::blankframe(){ vector newdata; data.insert(data.begin(),newdata); while (data.size()>history_size) { data.pop_back(); } } int Audioplotter::numpoints(){ int num=0; for (auto d=data.begin();d!=data.end();d++){ num+=d->size(); } return num; }