diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-05-24 23:15:50 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-05-24 23:15:50 +0100 |
| commit | 6a552a24799918101cf040542a6a48caed18a9d9 (patch) | |
| tree | 920681f98bfed65cc0d2c6f34a6454142657e8f4 | |
| parent | 404ae5da503cb6856b73b2638abb8785f6c47f6d (diff) | |
more controls
| -rw-r--r-- | gistanalysis/notes | 15 | ||||
| -rw-r--r-- | gistanalysis/src/ofApp.cpp | 32 | ||||
| -rw-r--r-- | gistanalysis/src/ofApp.h | 4 |
3 files changed, 40 insertions, 11 deletions
diff --git a/gistanalysis/notes b/gistanalysis/notes index 8b2a7d7..995c22c 100644 --- a/gistanalysis/notes +++ b/gistanalysis/notes @@ -60,11 +60,24 @@ other kinds of audio analysis -1- make dots work (+mirror?) - why- atm does it not +1- mirror (L/R) +easy fading +transform the origin ie vertical hold effects +segmenter effects +actual 3D? 2- an FFT thing with bars, similar, what's the ideal interface +3- sample waveforms randomly +4- more transforms, abstract transforms +5- set size of points +6- transition between colours +7- show or blank on onset +8- transform on onset +n- scriptable transforms - audio input - mapping - fix length overlap +- some kind of svg thing for ambulance with audio animation + diff --git a/gistanalysis/src/ofApp.cpp b/gistanalysis/src/ofApp.cpp index 59e7bdd..2c51e07 100644 --- a/gistanalysis/src/ofApp.cpp +++ b/gistanalysis/src/ofApp.cpp @@ -47,11 +47,15 @@ void ofApp::setup(){ gui.setup("panel"); // most of the time you don't need a name but don't forget to call setup + gui.add(fft.set("fft",false)); gui.add(joined.set("joined",true)); - gui.add(numPlots.set("num plots", 50, 1, 256)); - gui.add(scalePlot.set( "scale plot", 0.1f, 0.0f, 1.0f )); - gui.add(decayPlot.set( "decay", 0.9f, 0.0f, 1.0f )); + gui.add(numPoints.set("num points", 50, 1, 256)); + gui.add(numPlots.set("num plots", 5, 1, 100)); + gui.add(scalePlot.set("scale plot", 0.1f, 0.0f, 1.0f )); + gui.add(decayPlot.set("decay", 0.9f, 0.0f, 1.0f )); gui.add(xform.set("xform",ofVec2f(0,0),ofVec2f(-50,-50),ofVec2f(50,50))); + gui.add(rotate.set("rotate", 0.0f, -1.0f, 1.0f )); + gui.add(scale.set("scale",ofVec2f(1.0f,1.0f),ofVec2f(0.5f,0.5f),ofVec2f(2.0f,2.0f))); /* @@ -77,8 +81,8 @@ void ofApp::setup(){ soundStream.setup(this,0, 1, sampleRate, bufferSize, 1); - loadSong("12 Ferric Appetite.aiff"); - //loadSong("passades/1 The Ninth Set-sector1:sector2pt.1.aiff"); + //loadSong("12 Ferric Appetite.aiff"); + loadSong("passades/1 The Ninth Set-sector1:sector2pt.1.aiff"); //loadSong("assets/sounds/Coltrane_acc_VUIMM.wav"); plotter=Audioplotter(5,true); @@ -117,7 +121,9 @@ void ofApp::updateOutput(ofEventArgs& e){ processAudio(&output[0], bufferSize, 2); fftSmoothed = player.getFFT(); - plotter.addpoints(centre,numPlots); + plotter.set_joined(joined); + plotter.set_size(numPlots); + plotter.addpoints(fft?fftSmoothed:centre,numPoints); } } @@ -278,12 +284,18 @@ void ofApp::drawOutput(ofEventArgs & args){ */ - plotter.set_joined(joined); + + + ofMatrix4x4 t; + t.makeTranslationMatrix(xform->x,xform->y,0); + ofMatrix4x4 r; + r.makeRotationMatrix(rotate,ofVec3f(0,0,1)); + ofMatrix4x4 s; + r.makeScaleMatrix(scale->x,scale->y,1.0f); - ofMatrix4x4 _xform; - _xform.makeTranslationMatrix(xform->x,xform->y,0); + ofMatrix4x4 x=s*r*t; - vector <colourPolyline> lines=plotter.output(_xform,scalePlot,decayPlot); + vector <colourPolyline> lines=plotter.output(x,scalePlot,decayPlot); int num=laser.draw(lines,30); ofTranslate(0,ofGetHeight()/2); diff --git a/gistanalysis/src/ofApp.h b/gistanalysis/src/ofApp.h index 59bbfe6..52d67cd 100644 --- a/gistanalysis/src/ofApp.h +++ b/gistanalysis/src/ofApp.h @@ -172,10 +172,14 @@ class ofApp : public ofBaseApp, public ofxMidiListener{ ofxPanel gui; + ofParameter<bool> fft; ofParameter<bool> joined; + ofParameter<int> numPoints; ofParameter<int> numPlots; ofParameter<float> scalePlot; ofParameter<float> decayPlot; ofParameter<ofVec2f> xform; + ofParameter<float> rotate; + ofParameter<ofVec2f> scale; }; |
