summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2014-03-04 09:12:14 +0000
committerComment <tim@gray.(none)>2014-03-04 09:12:14 +0000
commitdcba98848683f582fd8348a937007f1fcdddd879 (patch)
tree7b2c5d7eb18d659343959f2e03eb51823335199b
parent598b4ac2377c6359323f54d570b704f5d912f483 (diff)
parentcaa1426e767efdba526c1d2df0b61aafbd6fcca7 (diff)
Merge branch 'master' of eclectronics.org@eclectronics.org:based
Conflicts: glitcher/src/audioGlitcher.h
-rw-r--r--glitcher/src/audioGlitcher.h38
-rw-r--r--glitcher/src/ofApp.cpp4
-rw-r--r--glitcher/src/ofApp.h2
3 files changed, 31 insertions, 13 deletions
diff --git a/glitcher/src/audioGlitcher.h b/glitcher/src/audioGlitcher.h
index cf88471..8d70411 100644
--- a/glitcher/src/audioGlitcher.h
+++ b/glitcher/src/audioGlitcher.h
@@ -22,10 +22,10 @@ class audioGlitcher {
samples=s;
origin_x=origin_y=0.5f;
trans_x=trans_y=0.0f;
- scale=1.0f;
+ scale=0.9f;
rotation=0.0f;
interp_x=16;
- interp_y=12;
+ interp_y=9;
}
void set_interp(int ix,int iy){
interp_x=ix;
@@ -57,6 +57,7 @@ class audioGlitcher {
cv::Mat srcX(interp_x,interp_y,CV_32FC1);
cv::Mat srcY(interp_x,interp_y,CV_32FC1);
+<<<<<<< HEAD
//for a sanity check
//512-1 / 16-1 = 34.066666667
//* 15=
@@ -66,6 +67,8 @@ class audioGlitcher {
float* dx = (float*)dstX.data;
float* dy = (float*)dstY.data;
+=======
+>>>>>>> caa1426e767efdba526c1d2df0b61aafbd6fcca7
float xFactor=(renderFBO.getWidth()-1)/(srcX.cols-1);
float yFactor=(renderFBO.getHeight()-1)/(srcX.rows-1);
for (int i=0;i<srcX.cols;i++){
@@ -77,9 +80,23 @@ class audioGlitcher {
}
}
+ //render =512x384
+ //interp = 16x12
+ //xFactor=34.133333 yFactor=34.90909
+
+ // srcX.at (11,15)=480
+ // srcY.at (11,15)=352
+
+ // ==it is an effect caused by the pixels being computed at the centres
+ // but finally being interpolated to the edges
+
//transform the low res matrix
float tX=trans_x; //-.05; //fraction of image
+<<<<<<< HEAD
float tY=trans_y; //-.08; //fraction of image
+=======
+ float tY=trans_y; //-.04; //fraction of image
+>>>>>>> caa1426e767efdba526c1d2df0b61aafbd6fcca7
float oX=origin_x; //fraction of image
float oY=origin_y; //fraction of image
float s=scale;
@@ -184,15 +201,9 @@ class audioGlitcher {
//ofRect(0,0,ofGetWidth(),ofGetHeight());
//ofDisableAlphaBlending();
- if (false){
- ofNoFill();
- ofPushMatrix();
- ofTranslate(renderFBO.getWidth()/2,renderFBO.getHeight()/2);
- ofRect(-20,-20,40,40);
- ofPopMatrix();
- }
+ bool useAudio=false;
- if (true) {
+ if (useAudio) {
ofPushMatrix();
ofTranslate(0,renderFBO.getHeight()/2);
@@ -215,6 +226,13 @@ class audioGlitcher {
ofPopMatrix();
}
+ else {
+ ofNoFill();
+ ofPushMatrix();
+ ofTranslate(renderFBO.getWidth()/2,renderFBO.getHeight()/2);
+ ofRect(-20,-20,40,40);
+ ofPopMatrix();
+ }
renderFBO.end();
//renderFBO.flagImageChanged();
diff --git a/glitcher/src/ofApp.cpp b/glitcher/src/ofApp.cpp
index acdd644..3a1b2b3 100644
--- a/glitcher/src/ofApp.cpp
+++ b/glitcher/src/ofApp.cpp
@@ -9,9 +9,9 @@ void ofApp::setup() {
int bufferSize= ofGetWidth(); //should be based on the size of glitch buffer
- soundStream.listDevices();
+ //soundStream.listDevices();
//nb all you have to do to make audio work is to turn off pulseaudio in configuration
- soundStream.setup(this, 0, 1, 44100, bufferSize, 1);
+ //soundStream.setup(this, 0, 1, 44100, bufferSize, 1);
samples.resize(bufferSize);
glitch.setup(ofGetWidth(),ofGetHeight(),&samples);
diff --git a/glitcher/src/ofApp.h b/glitcher/src/ofApp.h
index beaceaf..4767d0f 100644
--- a/glitcher/src/ofApp.h
+++ b/glitcher/src/ofApp.h
@@ -23,7 +23,7 @@ public:
audioGlitcher glitch;
- ofSoundStream soundStream;
+ //ofSoundStream soundStream;
vector<float> samples;
int frame;