diff options
| -rwxr-xr-x | Makefile | 2 | ||||
| -rwxr-xr-x | addons.make | 5 | ||||
| -rw-r--r-- | audio/Rite - 1 and 2 attacca.mp3 | bin | 0 -> 1674867 bytes | |||
| -rw-r--r-- | audio/rite 11.mp3 | bin | 0 -> 895896 bytes | |||
| -rw-r--r-- | audio/rite 13.mp3 | bin | 0 -> 876565 bytes | |||
| -rw-r--r-- | audio/rite 14.mp3 | bin | 0 -> 986175 bytes | |||
| -rw-r--r-- | audio/rite 3.mp3 | bin | 0 -> 1306227 bytes | |||
| -rw-r--r-- | audio/rite 4.mp3 | bin | 0 -> 1032359 bytes | |||
| -rw-r--r-- | audio/rite 5.mp3 | bin | 0 -> 695380 bytes | |||
| -rw-r--r-- | audio/rite 6.mp3 | bin | 0 -> 252970 bytes | |||
| -rw-r--r-- | audio/rite 7.mp3 | bin | 0 -> 380238 bytes | |||
| -rw-r--r-- | audio/rite 8.mp3 | bin | 0 -> 389851 bytes | |||
| -rw-r--r-- | audio/rite 9.mp3 | bin | 0 -> 1115011 bytes | |||
| -rwxr-xr-x | config.make | 56 | ||||
| -rwxr-xr-x | kirkos.cbp | 54 | ||||
| -rwxr-xr-x | src/main.cpp | 20 | ||||
| -rwxr-xr-x | src/testApp.cpp | 250 | ||||
| -rwxr-xr-x | src/testApp.h | 96 | ||||
| -rwxr-xr-x | src/viewport.cpp | 65 | ||||
| -rwxr-xr-x | src/viewport.h | 38 |
20 files changed, 586 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..2d83a77 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +include config.make +include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/Makefile.examples diff --git a/addons.make b/addons.make new file mode 100755 index 0000000..bf54c6b --- /dev/null +++ b/addons.make @@ -0,0 +1,5 @@ +ofxXmlSettings +ofxFenster +ofxGui +ofxExtras + diff --git a/audio/Rite - 1 and 2 attacca.mp3 b/audio/Rite - 1 and 2 attacca.mp3 Binary files differnew file mode 100644 index 0000000..2afc9be --- /dev/null +++ b/audio/Rite - 1 and 2 attacca.mp3 diff --git a/audio/rite 11.mp3 b/audio/rite 11.mp3 Binary files differnew file mode 100644 index 0000000..51598cd --- /dev/null +++ b/audio/rite 11.mp3 diff --git a/audio/rite 13.mp3 b/audio/rite 13.mp3 Binary files differnew file mode 100644 index 0000000..422c429 --- /dev/null +++ b/audio/rite 13.mp3 diff --git a/audio/rite 14.mp3 b/audio/rite 14.mp3 Binary files differnew file mode 100644 index 0000000..f2504f9 --- /dev/null +++ b/audio/rite 14.mp3 diff --git a/audio/rite 3.mp3 b/audio/rite 3.mp3 Binary files differnew file mode 100644 index 0000000..9054d02 --- /dev/null +++ b/audio/rite 3.mp3 diff --git a/audio/rite 4.mp3 b/audio/rite 4.mp3 Binary files differnew file mode 100644 index 0000000..fe3673c --- /dev/null +++ b/audio/rite 4.mp3 diff --git a/audio/rite 5.mp3 b/audio/rite 5.mp3 Binary files differnew file mode 100644 index 0000000..bb8d0af --- /dev/null +++ b/audio/rite 5.mp3 diff --git a/audio/rite 6.mp3 b/audio/rite 6.mp3 Binary files differnew file mode 100644 index 0000000..3b2c8aa --- /dev/null +++ b/audio/rite 6.mp3 diff --git a/audio/rite 7.mp3 b/audio/rite 7.mp3 Binary files differnew file mode 100644 index 0000000..30c277c --- /dev/null +++ b/audio/rite 7.mp3 diff --git a/audio/rite 8.mp3 b/audio/rite 8.mp3 Binary files differnew file mode 100644 index 0000000..d849023 --- /dev/null +++ b/audio/rite 8.mp3 diff --git a/audio/rite 9.mp3 b/audio/rite 9.mp3 Binary files differnew file mode 100644 index 0000000..5313207 --- /dev/null +++ b/audio/rite 9.mp3 diff --git a/config.make b/config.make new file mode 100755 index 0000000..5bfa48a --- /dev/null +++ b/config.make @@ -0,0 +1,56 @@ +# add custom variables to this file + +# OF_ROOT allows to move projects outside apps/* just set this variable to the +# absoulte path to the OF root folder + +OF_ROOT = ../openFrameworks + + +# USER_CFLAGS allows to pass custom flags to the compiler +# for example search paths like: +# USER_CFLAGS = -I src/objects + +USER_CFLAGS = -std=c++11 + + +# USER_LDFLAGS allows to pass custom flags to the linker +# for example libraries like: +# USER_LDFLAGS = libs/libawesomelib.a + +USER_LDFLAGS = + + +EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj" + +# change this to add different compiler optimizations to your project + +USER_COMPILER_OPTIMIZATION = -march=native -mtune=native -Os + + +# android specific, in case you want to use different optimizations +USER_LIBS_ARM = +USER_LIBS_ARM7 = +USER_LIBS_NEON = + +# android optimizations + +ANDROID_COMPILER_OPTIMIZATION = -Os + +NDK_PLATFORM = android-8 + +# uncomment this for custom application name (if the folder name is different than the application name) +#APPNAME = folderName + +# uncomment this for custom package name, must be the same as the java package that contains OFActivity +#PKGNAME = cc.openframeworks.$(APPNAME) + + + + + +# linux arm flags + +LINUX_ARM7_COMPILER_OPTIMIZATIONS = -march=armv7-a -mtune=cortex-a8 -finline-functions -funroll-all-loops -O3 -funsafe-math-optimizations -mfpu=neon -ftree-vectorize -mfloat-abi=hard -mfpu=vfp + + + diff --git a/kirkos.cbp b/kirkos.cbp new file mode 100755 index 0000000..528fa23 --- /dev/null +++ b/kirkos.cbp @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="kirkos" /> + <Option makefile_is_custom="1" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Option virtualFolders="addons/;src/;build config/;" /> + <Build> + <Target title="Debug"> + <Option output="bin/$(PROJECT_NAME)_debug" prefix_auto="1" extension_auto="1" /> + <Option working_dir="bin" /> + <Option object_output="obj/Debug/" /> + <Option external_deps="../../../libs/openFrameworksCompiled/lib/linux/libopenFrameworksDebug.a;" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Option projectLinkerOptionsRelation="2" /> + </Target> + <Target title="Release"> + <Option output="bin/$(PROJECT_NAME)" prefix_auto="1" extension_auto="1" /> + <Option working_dir="bin" /> + <Option object_output="obj/Release/" /> + <Option external_deps="../../../libs/openFrameworksCompiled/lib/linux/libopenFrameworks.a;" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Option projectLinkerOptionsRelation="2" /> + </Target> + </Build> + <Unit filename="config.make"> + <Option virtualFolder="build config" /> + </Unit> + <Unit filename="src/main.cpp"> + <Option virtualFolder="src/" /> + </Unit> + <Unit filename="src/testApp.cpp"> + <Option virtualFolder="src/" /> + </Unit> + <Unit filename="src/testApp.h"> + <Option virtualFolder="src/" /> + </Unit> + <Unit filename="src/viewport.cpp"> + <Option virtualFolder="src/" /> + </Unit> + <Unit filename="src/viewport.h"> + <Option virtualFolder="src/" /> + </Unit> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + </Extensions> + </Project> +</CodeBlocks_project_file> diff --git a/src/main.cpp b/src/main.cpp new file mode 100755 index 0000000..f0c0c0f --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,20 @@ +#include "ofMain.h" +#include "testApp.h" +#include "ofxFensterManager.h" +#include "ofAppGlutWindow.h" + +//======================================================================== +int main( ){ + + ofAppGlutWindow window; + ofSetupOpenGL(ofxFensterManager::get(),1024,768, OF_WINDOW); //2048,768 + //ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // <-------- setup the GL context + //ofSetupOpenGL(&window, 1024,768, OF_WINDOW); + + // this kicks off the running of my app + // can be OF_WINDOW or OF_FULLSCREEN + // pass in width and height too: + //ofRunApp( new testApp()); + ofRunFensterApp( new testApp()); + +} diff --git a/src/testApp.cpp b/src/testApp.cpp new file mode 100755 index 0000000..bc2fe0e --- /dev/null +++ b/src/testApp.cpp @@ -0,0 +1,250 @@ +#include "testApp.h" +previewWindow::~previewWindow(){ + cout << "preview window destroyed" << endl; +} +void previewWindow::setup(){} +void previewWindow::setParent(testApp *p){ + parent=p; +} +void previewWindow::draw(){ + + for (auto i:parent->viewports) i.draw(parent->brightSlider); + +} +//-------------------------------------------------------------- +guiWindow::~guiWindow(){ + cout << "gui window destroyed" << endl; +} +void guiWindow::setup(){} +void guiWindow::setParent(testApp *p){ + parent=p; +} +void guiWindow::draw(){ + + parent->gui.draw(); + +} +//-------------------------------------------------------------- +void testApp::create1port(bool & pressed){ + if (!pressed) return; + viewports.clear(); + viewports.push_back(viewport(4*windowsize,2*windowsize,0,0)); + createports(1); +} +void testApp::create2port(bool & pressed){ + if (!pressed) return; + viewports.clear(); + viewports.push_back(viewport(2*windowsize,2*windowsize,0,0)); + viewports.push_back(viewport(2*windowsize,2*windowsize,2*windowsize,0)); + createports(2); +} +void testApp::create4port(bool & pressed){ + if (!pressed) return; + viewports.clear(); + viewports.push_back(viewport(windowsize,2*windowsize,0,0)); + viewports.push_back(viewport(windowsize,2*windowsize,windowsize,0)); + viewports.push_back(viewport(windowsize,2*windowsize,2*windowsize,0)); + viewports.push_back(viewport(windowsize,2*windowsize,3*windowsize,0)); + + createports(4); +} +void testApp::create8port(bool & pressed){ + if (!pressed) return; + viewports.clear(); + viewports.push_back(viewport(windowsize,windowsize,0,0)); + viewports.push_back(viewport(windowsize,windowsize,(1*windowsize),0)); + viewports.push_back(viewport(windowsize,windowsize,(2*windowsize),0)); + viewports.push_back(viewport(windowsize,windowsize,(3*windowsize),0)); + viewports.push_back(viewport(windowsize,windowsize,0,windowsize)); + viewports.push_back(viewport(windowsize,windowsize,(1*windowsize),windowsize)); + viewports.push_back(viewport(windowsize,windowsize,(2*windowsize),windowsize)); + viewports.push_back(viewport(windowsize,windowsize,(3*windowsize),windowsize)); + createports(8); +} +void testApp::createports(int num){ + cerr<<"created "<<num<<" ports"<<endl; +} +//-------------------------------------------------------------- +void testApp::setup(){ + + windowsize=100; + + + showFPS=false; + ofBackground(0,0,0); + ofSetBackgroundAuto(true); + ofSetFrameRate(60); + + //preview window stuff + prevWin=new previewWindow(); + win=ofxFensterManager::get()->createFenster(0, 0, windowsize*4, windowsize*2, OF_WINDOW); + ofAddListener(win->events.keyPressed, this, &testApp::keyPressedEvent); + win->setWindowTitle("preview"); + win->addListener(prevWin); + prevWin->setup(); + prevWin->setParent(this); + + fullscreenoutput=false; + + guiWin=new guiWindow(); + gui.setup("","panel.xml",0,0); + + brightSlider=0; + gui.add(bS.setup("brightness",brightSlider,0,255,255)); + + gui.add(create_1.setup("1")); + create_1.addListener(this,&testApp::create1port); + gui.add(create_2.setup("2")); + create_2.addListener(this,&testApp::create2port); + gui.add(create_4.setup("4")); + create_4.addListener(this,&testApp::create4port); + gui.add(create_8.setup("8")); + create_8.addListener(this,&testApp::create8port); + + gui.add(fillgrey.setup("fill grey", false)); + greyFreq=1.0f; + gui.add(gF.setup("grey freq",greyFreq,0,2.0,255)); + + +/* + gui.setup("","panel.xml",0,0); + gui.add(reversemain.setup("reverse main", false)); + gui.add(controlColours.setup("control colours", false)); + gui.add(noteRandomiseColours.setup("randomise note colours", false)); + gui.add(transparentBlack.setup("transparent black", false)); + gui.add(resetDrawscale.setup("reset draw scale")); + gui.add(resetFBscale.setup("reset FB scale")); + fadeScale=128; + gui.add(fS.setup("fade scale",fadeScale,0,255,255)); + decayTime=1.0f; + gui.add(dT.setup("decay time",decayTime,0,10.0,255)); + + gui.add(oscScale.setup("scale size LFO", false)); + gui.add(breakOsc.setup("break oscillators", false)); + gui.add(randomOsc.setup("randomise oscillators", false)); + scaleAmplitude=0.5f; + gui.add(sA.setup("fade scale",scaleAmplitude,0,2.0,255)); + scaleFrequency=1.0f; + gui.add(sF.setup("fade freq",scaleFrequency,0,5.0,255)); + + resetDrawscale.addListener(this,&testApp::resetDrawscalePressed); + resetFBscale.addListener(this,&testApp::resetFBscalePressed); + */ + + //gui window stuff + ofxFenster* win2=ofxFensterManager::get()->createFenster(0, 0, 200, 400, OF_WINDOW); + + win2->setWindowTitle("config"); + win2->addListener(guiWin); + guiWin->setup(); + guiWin->setParent(this); + + +} + + + + + +//-------------------------------------------------------------- +void testApp::update(){ + //for (int i=0;i<numLayers;i++) layers[i]->update(); +} + +//-------------------------------------------------------------- +void testApp::draw(){ + + control.fillgrey=fillgrey; + control.fillgreyfreq=greyFreq; + + for (auto i:viewports) i.drawport(control); + + ofPushMatrix(); + ofTranslate((ofGetWidth()/2)-(2*windowsize),(ofGetHeight()/2)-windowsize); + for (auto i:viewports) i.draw((uint8_t)brightSlider); + ofPopMatrix(); + + ofSetColor(255,255,255); + if (showFPS) ofDrawBitmapString(ofToString(ofGetFrameRate(), 2),20,20); + +} + +//-------------------------------------------------------------- +void testApp::keyPressed(int key, ofxFenster* win){ + if(key == ' '){ + fullscreenoutput=!fullscreenoutput; + win->setFullscreen(fullscreenoutput); + printf("resolution: %ix%i %s\n",win->getWidth(),win->getHeight(),fullscreenoutput?"fullscreen":"windowed"); + } + else keyPressed(key); +} +void testApp::keyPressed(int key){ + + if(key == 'f'){ + toggleFPS(); + } + +} + +//-------------------------------------------------------------- +void testApp::keyReleased(int key){ + +} + +//-------------------------------------------------------------- +void testApp::mouseMoved(int x, int y ){ + +} + +//-------------------------------------------------------------- +void testApp::mouseDragged(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void testApp::mouseReleased(int x, int y, int button){ + + +} +void testApp::mousePressed(int x, int y, int button) { +} + +//-------------------------------------------------------------- +void testApp::windowResized(int w, int h){ + +} + +//-------------------------------------------------------------- +void testApp::gotMessage(ofMessage msg){ + +} + +//-------------------------------------------------------------- + + +void testApp::mousePressedEvent(ofMouseEventArgs &args) { + //printf("mouse: %i,%i %i of %ix%i\n",args.x,args.y,args.button,win->getWidth(),win->getHeight()); + //0-2 + switch (args.button) { + case 0: + control.xshift=args.x-(win->getWidth()/2); + control.yshift=args.y-(win->getHeight()/2); + break; + case 1: + control.scale=pow(pow(args.x-(win->getWidth()/2),2)+pow(args.y-(win->getHeight()/2),2),0.5)/(win->getWidth()*.1); + break; + case 2: + control.fscale=(pow(pow(args.x-(win->getWidth()/2),2)+pow(args.y-(win->getHeight()/2),2),0.5)/(win->getWidth()))+0.5; + break; + } +} + +void testApp::keyPressedEvent(ofKeyEventArgs &args) { + //printf("window key pressed: %i (%c)\n",args.key,args.key); + keyPressed(args.key); +} + +void testApp::toggleFPS(){ + showFPS=!showFPS; +} + diff --git a/src/testApp.h b/src/testApp.h new file mode 100755 index 0000000..cc46dfc --- /dev/null +++ b/src/testApp.h @@ -0,0 +1,96 @@ +#pragma once + +#include "ofMain.h" + +#include "ofxFensterManager.h" +#include "ofxGui.h" + +#include "viewport.h" + + + +class previewWindow; +class guiWindow; + +//#define GRAB_TEXTURE + +class testApp : public ofxFensterListener { + + public: + + void setup(); + void update(); + void draw(); + + void keyPressed(int key, ofxFenster* win); + void keyPressed(int key); + void keyReleased(int key); + void mouseMoved(int x, int y ); + void mouseDragged(int x, int y, int button); + void mousePressed(int x, int y, int button); + void mouseReleased(int x, int y, int button); + void windowResized(int w, int h); + void gotMessage(ofMessage msg); + + void mousePressedEvent(ofMouseEventArgs &args); + void keyPressedEvent(ofKeyEventArgs &args); + void windowEvent(ofResizeEventArgs &args); + + void toggleFPS(); + bool showFPS; + + bool fullscreenoutput; + + previewWindow *prevWin; + guiWindow *guiWin; + ofxFenster* win; + + + ofxPanel gui; + + ofxButton create_1; + ofxButton create_2; + ofxButton create_4; + ofxButton create_8; + + ofxToggle dotrans; + + ofxIntSlider bS; + ofxParameter<int> brightSlider; + + ofxToggle fillgrey; + + ofxFloatSlider gF; + ofxParameter<float> greyFreq; + + void create1port(bool & pressed); + void create2port(bool & pressed); + void create4port(bool & pressed); + void create8port(bool & pressed); + void createports(int num); + + vector<viewport> viewports; + vpcontrol control; + int windowsize; +}; + + +class previewWindow: public ofxFensterListener{ +public: + ~previewWindow(); + testApp *parent; + void setup(); + void setParent(testApp *p); + void draw(); +}; + +class guiWindow: public ofxFensterListener{ +public: + ~guiWindow(); + testApp *parent; + void setup(); + void setParent(testApp *p); + void draw(); +}; + + diff --git a/src/viewport.cpp b/src/viewport.cpp new file mode 100755 index 0000000..875b439 --- /dev/null +++ b/src/viewport.cpp @@ -0,0 +1,65 @@ +#include "viewport.h"
+
+viewport::viewport()
+{
+ //ctor
+}
+viewport::viewport(int _w,int _h,int _ox,int _oy) {
+ setup(_w,_h,_ox,_oy);
+}
+
+void viewport::setup(int _w,int _h,int _ox,int _oy) {
+ w=_w;
+ h=_h;
+ ox=_ox;
+ oy=_oy;
+ rb1.allocate(w,h,GL_RGB);
+ rb2.allocate(w,h,GL_RGB);
+ seed=ofRandom(1.0f);
+}
+
+void viewport::drawport(vpcontrol &control){
+
+ rb1.begin();
+
+ //can be done with texture offset?
+
+ int startx=((w-(w*control.fscale))/2)+control.xshift;
+ while (startx>0) startx-=(w*control.fscale);
+ int starty=((h-(h*control.fscale))/2)+control.yshift;
+ while (starty>0) starty-=(h*control.fscale);
+
+ for (int i=startx;i<w*2;i+=(w*control.fscale)) {
+ for (int j=starty;j<h*2;j+=(h*control.fscale)) {
+ rb2.draw(i,j,w*control.fscale,h*control.fscale);
+ }
+ }
+
+ //do whatever with feedback
+
+ if (control.fillgrey){
+ uint8_t f=(uint8_t)((sin((ofGetElapsedTimef()*control.fillgreyfreq)/seed)+1.0f)*127.50f);
+ ofSetColor(f,f,f);
+ ofRect(0,0,w,h);
+ }
+
+
+ rb1.end();
+
+ rb2.begin();
+ ofSetColor(255,255,255);
+ rb1.draw(0,0);
+ rb2.end();
+
+}
+void viewport::draw(uint8_t b){
+
+ ofSetColor(b,b,b);
+ rb2.draw(ox,oy);
+
+}
+
+viewport::~viewport()
+{
+ //dtor
+}
diff --git a/src/viewport.h b/src/viewport.h new file mode 100755 index 0000000..9d2b72c --- /dev/null +++ b/src/viewport.h @@ -0,0 +1,38 @@ +#ifndef VIEWPORT_H
+#define VIEWPORT_H
+
+#include "ofMain.h"
+
+class vpcontrol {
+ public:
+ vpcontrol(){
+ fillgrey=false;
+ fillgreyfreq=1.0f;
+ xshift=0;
+ yshift=0;
+ fscale=1.0f;
+ }
+ bool fillgrey;
+ float fillgreyfreq;
+ int xshift,yshift;
+ float fscale,scale;
+
+};
+
+class viewport
+{
+ public:
+ viewport();
+ viewport(int _w,int _h,int _ox,int _oy);
+ virtual ~viewport();
+ void setup(int _w,int _h,int _ox,int _oy);
+ void drawport(vpcontrol &control);
+ void draw(uint8_t brightness);
+ ofFbo rb1,rb2;
+ protected:
+ private:
+ int x,y,w,h,ox,oy;
+ float seed;
+};
+
+#endif // VIEWPORT_H
|
