working structure

This commit is contained in:
incandenza 2021-07-23 12:31:58 +02:00
parent 0798e9ac17
commit ed74b09164
6 changed files with 21 additions and 5 deletions

View file

@ -0,0 +1 @@
ofxFft

View file

@ -76,7 +76,7 @@
# add a runtime path to search for those shared libraries, since they aren't
# incorporated directly into the final executable application binary.
################################################################################
# PROJECT_LDFLAGS=-Wl,-rpath=./libs
PROJECT_LDFLAGS=-Wl,-rpath=./libs /opt/openFrameworks/addons/ofxFft/libs/fftw/lib/libfftw3f.a
################################################################################
# PROJECT DEFINES

View file

@ -8,7 +8,7 @@ Line::Line()
setX(0);
setY(0);
}
Line::Line(float &x, float &y)
Line::Line(const float &x, const float &y)
{
setX(x);
setY(y);
@ -22,7 +22,7 @@ void Line::setup(){
};
void Line::draw(){
ofDrawLine(glm::vec2(ofRandom(getX(),ofGetWidth()),ofRandom(getY(),ofGetHeight())),glm::vec2(ofRandom(getX(),ofGetWidth()),ofRandom(getY(),ofGetHeight())));
};
void Line::update(const Randomness *rthings){

View file

@ -9,7 +9,7 @@ class Line : public Glitch
public:
//contructor
Line();
Line(float &x, float &y);
Line(const float &x, const float &y);
//destructor
~Line();

View file

@ -56,6 +56,13 @@ void ofApp::setup(){
settings.numInputChannels = 2;
settings.bufferSize = bufferSize;
soundStream.setup(settings);
///preparing visula glitch
Line l=Line(10.0f,10.0f);
l.setX(12.0f);
glitches.push_back(new Line(300.0f,300.0f));
// audioAnalyzer.setup(48000, bufferSize, 2);
}
@ -86,7 +93,12 @@ void ofApp::draw(){
if(coinToss <= 1){
ofSetLineWidth( map(coinToss,0,3,1,5));
ofDrawLine(glm::vec2(ofRandom(0,ofGetWidth()),ofRandom(0,ofGetHeight())),glm::vec2(ofRandom(0,ofGetWidth()),ofRandom(0,ofGetHeight())));
//ofDrawLine(glm::vec2(ofRandom(0,ofGetWidth()),ofRandom(0,ofGetHeight())),glm::vec2(ofRandom(0,ofGetWidth()),ofRandom(0,ofGetHeight())));
for(auto & g : glitches)
{
g->draw();
}
}

View file

@ -2,6 +2,8 @@
#include "ofMain.h"
#include "ofxFft.h"
#include "mnglitches/glitch.h"
#include "mnglitches/line.h"
//#include "ofxVoronoi2D.h"
//#include "ofxAudioAnalyzer.h"
@ -54,6 +56,7 @@ private:
// ofxAudioAnalyzer audioAnalyzer;
//glitch
float coinToss;
vector <Glitch*> glitches;