diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-06-01 13:27:10 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-06-01 13:27:10 +0100 |
| commit | 48bc405b72009d9cef3dbf07a5d68337b678b98e (patch) | |
| tree | e89dd4c34381255b196495911385db18a80167c9 | |
| parent | b036871dd531cb3adc8ff744d2e4804efbccc0e6 (diff) | |
chaos scaling
| -rw-r--r-- | gistanalysis/notes | 3 | ||||
| -rw-r--r-- | gui/src/AudioPlotter.cpp | 6 | ||||
| -rw-r--r-- | gui/src/AudioPlotter.h | 1 | ||||
| -rw-r--r-- | gui/src/main.cpp | 4 | ||||
| -rw-r--r-- | gui/src/ofApp.cpp | 20 | ||||
| -rw-r--r-- | gui/src/ofApp.h | 4 |
6 files changed, 28 insertions, 10 deletions
diff --git a/gistanalysis/notes b/gistanalysis/notes index eb389b4..6a2db7f 100644 --- a/gistanalysis/notes +++ b/gistanalysis/notes @@ -105,3 +105,6 @@ audioplot mirror & random sampling get some content for ambulance seems to be a bug when closing while the mic is live + +random sampling +onsets turning things on diff --git a/gui/src/AudioPlotter.cpp b/gui/src/AudioPlotter.cpp index e78e8ba..ba78f1e 100644 --- a/gui/src/AudioPlotter.cpp +++ b/gui/src/AudioPlotter.cpp @@ -3,12 +3,12 @@ colourPolyline Audioplotter::compute_chaos(colourPolyline& poly,float colourFade){ colourPolyline tempPoly; for (int i=0;i<poly.size();i++){ - REAL iv[6]={poly[i].x,poly[i].y,chaos_a,chaos_b,chaos_k,chaos_p}; - //ofLog() << i<<": calculating chaos with: "<<poly[i].x<<" "<<poly[i].y<<" "<<attractor.a<<" "<<attractor.b<<" "<<attractor.k<<" "<<attractor.p; + REAL iv[6]={(poly[i].x-(ofGetWidth()/2))/chaosscale,(poly[i].y-(ofGetHeight()/2))/chaosscale,chaos_a,chaos_b,chaos_k,chaos_p}; + //ofLog() << i<<": calculating chaos with: "<<poly[i].x<<"->"<<((poly[i].x-(ofGetWidth()/2))/chaosscale)<<" "<<poly[i].y<<"->"<<((poly[i].y-(ofGetHeight()/2))/chaosscale)<<" "<<attractor.a<<" "<<attractor.b<<" "<<attractor.k<<" "<<attractor.p; attractor.set(iv); attractor.calc(); //ofLog() << i<<": got points: "<<attractor.nx<<" "<<attractor.ny; - tempPoly.addVertex(ofPoint(attractor.nx,attractor.ny),poly.getColourAt(i)*colourFade); + tempPoly.addVertex(ofPoint((attractor.nx*chaosscale)+(ofGetWidth()/2),(attractor.ny*chaosscale)+(ofGetHeight()/2)),poly.getColourAt(i)*colourFade); } return tempPoly; } diff --git a/gui/src/AudioPlotter.h b/gui/src/AudioPlotter.h index a1495c3..3bbb20c 100644 --- a/gui/src/AudioPlotter.h +++ b/gui/src/AudioPlotter.h @@ -41,6 +41,7 @@ public: ofParameter<bool> usechaos; ofParameter<float> chaosamount; + ofParameter<float> chaosscale; ofParameter<float> chaos_a; ofParameter<float> chaos_b; ofParameter<float> chaos_k; diff --git a/gui/src/main.cpp b/gui/src/main.cpp index 1221d37..0d2fa2d 100644 --- a/gui/src/main.cpp +++ b/gui/src/main.cpp @@ -20,8 +20,8 @@ int main(int argc, char *argv[]){ shared_ptr<ofAppBaseWindow> mainWindow = ofCreateWindow(settings); mainWindow->setVerticalSync(false); - settings.width = 600; - settings.height = 1000; + settings.width = 700; + settings.height = 1100; settings.setPosition(ofVec2f(0,0)); settings.resizable = true; diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index af03943..b7092f7 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -57,7 +57,7 @@ void ofApp::setup(){ //============================ gui - lasergui.setup("laser"); + lasergui.setup("laser","",230,820); lasergui.add(laser_power.set("power", false)); lasergui.add(laser_intensity.set("intensity", 30, 0, 255)); lasergui.add(laser_points.set("points", 30000, 0, 40000)); @@ -65,7 +65,16 @@ void ofApp::setup(){ lasergui.add(laser_blank_num.set("blank points", 8, 0, 32)); lasergui.add(laser_max_angle.set("max angle", 15.0f, 1.0f, 90.0f)); - drawgui.setup("drawing","",10,150); + chaosgui.setup("chaos","",460,820); + chaosgui.add(plotter.usechaos.set("use",false)); + chaosgui.add(plotter.chaosamount.set("amount", 0.5f, 0.0f, 1.0f)); + chaosgui.add(plotter.chaosscale.set("scale", 10.0f, 1.0f, 250.0f)); + chaosgui.add(plotter.chaos_a.set("a", 0.85f, 0.0f, 10.0f)); + chaosgui.add(plotter.chaos_b.set("b", 0.9f, 0.0f, 10.0f)); + chaosgui.add(plotter.chaos_k.set("k", 0.4f, 0.0f, 10.0f)); + chaosgui.add(plotter.chaos_p.set("p", 7.7f, 0.0f, 10.0f)); + + drawgui.setup("drawing","",10,0); drawgui.add(contour_threshold.setup("threshold", 140, 0, 255)); drawgui.add(contour_simplify.setup("simplify", 0.8, 0.0, 1.0)); drawgui.add(contour_useColour.setup("use colour", true)); @@ -89,7 +98,7 @@ void ofApp::setup(){ drawgui.add(xf_scale_min.setup("scale min", 1.0, 0.0, 3.0)); drawgui.add(xf_scale_max.setup("scale max", 2.0, 0.0, 3.0)); - audiogui.setup("audio","",10,600); + audiogui.setup("audio","",10,450); audiogui.add(useMic.set("mic",false)); audiogui.add(useFft.set("fft",false)); audiogui.add(scalePlot.set("plotscale", 0.1f, 0.0f, 1.0f )); //parameters are recognised by name only? @@ -492,6 +501,7 @@ void ofApp::draw(){ lasergui.draw(); drawgui.draw(); audiogui.draw(); + chaosgui.draw(); //================================== NDI /* @@ -571,7 +581,7 @@ void ofApp::draw(){ glPushMatrix(); - glTranslatef(230,300,0); + glTranslatef(230,270,0); ofDrawRectangle(20,20,previewframesize.x+4,previewframesize.y+4); @@ -589,7 +599,7 @@ void ofApp::draw(){ glPushMatrix(); - glTranslatef(230,600,0); + glTranslatef(230,540,0); ofDrawRectangle(20,20,previewframesize.x+4,previewframesize.y+4); diff --git a/gui/src/ofApp.h b/gui/src/ofApp.h index c9b1c4f..39c3493 100644 --- a/gui/src/ofApp.h +++ b/gui/src/ofApp.h @@ -116,6 +116,10 @@ class ofApp: public ofBaseApp, public ofxMidiListener { ofParameter<float> decayPlot; void useMicChanged(); + + //======== chaos gui + + ofxPanel chaosgui; //======================================== //thresholding |
