From d59dff2cc79b63962009786cc19223fa5a197757 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 2 Dec 2018 22:15:09 +0000 Subject: other voices --- gui/bin/data/settings.xml | 4 +- gui/src/ofApp.cpp | 95 ++++++++++++++++++++++++----------------------- gui/src/ofApp.h | 2 +- 3 files changed, 52 insertions(+), 49 deletions(-) (limited to 'gui') diff --git a/gui/bin/data/settings.xml b/gui/bin/data/settings.xml index ced1c18..4e3523f 100644 --- a/gui/bin/data/settings.xml +++ b/gui/bin/data/settings.xml @@ -18,8 +18,8 @@ - -3.514287949 - -202.628555298 + -17.628570557 + -187.371429443 2.863990068 diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index 689048c..9efdead 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -759,48 +759,50 @@ void ofApp::drawOutput(ofEventArgs & args){ break; } case SVG_outlines:{ - if (shapes_randomise){ - //if (framecounter==0){ - // select_random_shapes(); - // framecounter=shapes_duration; - //} - select_random_shapes(shapes_duration); - for (auto s:shape_selection){ - if (use_segmenter){ - auto segments=segmenters[s].getSegments(segmenter_number,segmenter_length,phase); - for (auto segment=segments.begin();segment!=segments.end();segment++){ - //polyOutput.push_back(colourPolyline(*segment,ofColor(laser_R,laser_G,laser_B))); - polyOutput.push_back(*segment); + if (!use_onset||onset_framegetSegments(segmenter_number,segmenter_length,phase); - for (auto segment=segments.begin();segment!=segments.end();segment++){ - //polyOutput.push_back(colourPolyline(*segment,ofColor(laser_R,laser_G,laser_B))); - polyOutput.push_back(*segment); + else { + for (auto shape=segmenters.begin();shape!=segmenters.end();shape++){ + if (use_segmenter){ + auto segments=shape->getSegments(segmenter_number,segmenter_length,phase); + for (auto segment=segments.begin();segment!=segments.end();segment++){ + //polyOutput.push_back(colourPolyline(*segment,ofColor(laser_R,laser_G,laser_B))); + polyOutput.push_back(*segment); + } + } + else { + //polyOutput.push_back(colourPolyline(shape->getPoly(),ofColor(laser_R,laser_G,laser_B))); + polyOutput.push_back(shape->getPoly()); } - } - else { - //polyOutput.push_back(colourPolyline(shape->getPoly(),ofColor(laser_R,laser_G,laser_B))); - polyOutput.push_back(shape->getPoly()); } } - } - if (contour_useColour){ - vector newPolys; - for (auto p: polyOutput){ - newPolys.push_back(colourPolyline((ofPolyline)p,ofColor(laser_R,laser_G,laser_B))) ; + if (contour_useColour){ + vector newPolys; + for (auto p: polyOutput){ + newPolys.push_back(colourPolyline((ofPolyline)p,ofColor(laser_R,laser_G,laser_B))) ; + } + polyOutput=newPolys; } - polyOutput=newPolys; } break; } @@ -1085,7 +1087,7 @@ void ofApp::windowResized(int w, int h){ float last_frame_time=0.0f; -void ofApp::select_random_shapes(float duration){ +void ofApp::select_random_shapes(float duration,bool generate){ float timedelta=ofGetElapsedTimef()-last_frame_time; last_frame_time=ofGetElapsedTimef(); //track how long each shape has been selected @@ -1108,18 +1110,19 @@ void ofApp::select_random_shapes(float duration){ } //cout << timedelta <<": decay selection: "<