diff options
Diffstat (limited to 'gistanalysis/src/ofApp.cpp')
| -rw-r--r-- | gistanalysis/src/ofApp.cpp | 32 |
1 files changed, 22 insertions, 10 deletions
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); |
