Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bin/data/scenes/mindmachine/exampleCode.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// you might want to close your eyes and let go

void draw(){
int microsePerWave = (int)( 1000*1000 / ( [[Brain Frequency]] *2 ));
int wave = ofGetElapsedTimeMicros() / microsePerWave;
int lastWave = last / microsePerWave;
last = ofGetElapsedTimeMicros();

if(wave > lastWave) flip *= -1;
int alpha = ofMap(flip, -1, 1, 0, 255);

ofBackground(alpha);
}
14 changes: 14 additions & 0 deletions d4nSFPCRunner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; };
E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */; };
E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */; };
EF8EF8F71C284680006C7B1B /* mindmachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EF8EF8F51C284680006C7B1B /* mindmachine.cpp */; };
F285EB3169F1566CA3D93C20 /* ofxPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E112B3AEBEA2C091BF2B40AE /* ofxPanel.cpp */; };
FA361F451C18862D00F197F3 /* veraMolnarLines68.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA361F431C18862D00F197F3 /* veraMolnarLines68.cpp */; };
FA361F491C1887A400F197F3 /* alexGifPaletteDitherMenkman.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA361F471C1887A400F197F3 /* alexGifPaletteDitherMenkman.cpp */; };
Expand Down Expand Up @@ -403,6 +404,8 @@
E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; };
E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = "<group>"; };
ECF8674C7975F1063C5E30CA /* ofxGuiGroup.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofxGuiGroup.cpp; path = ../../../addons/ofxGui/src/ofxGuiGroup.cpp; sourceTree = SOURCE_ROOT; };
EF8EF8F51C284680006C7B1B /* mindmachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mindmachine.cpp; sourceTree = "<group>"; };
EF8EF8F61C284680006C7B1B /* mindmachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mindmachine.h; sourceTree = "<group>"; };
FA361F431C18862D00F197F3 /* veraMolnarLines68.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = veraMolnarLines68.cpp; sourceTree = "<group>"; };
FA361F441C18862D00F197F3 /* veraMolnarLines68.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = veraMolnarLines68.h; sourceTree = "<group>"; };
FA361F471C1887A400F197F3 /* alexGifPaletteDitherMenkman.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = alexGifPaletteDitherMenkman.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -733,6 +736,7 @@
9238719D1BF7993A00171456 /* scenes */ = {
isa = PBXGroup;
children = (
EF8EF8F41C284680006C7B1B /* mindmachine */,
C1DB5A341C272DEE000C2F7C /* ofxDataBender */,
B08FE1911C23B39F0037252E /* RileyRemake-Catarina_Lee__Joao_Freire */,
C13A36701C17906200F13242 /* aaronMarcusHieroglyphB */,
Expand Down Expand Up @@ -1349,6 +1353,15 @@
name = openFrameworks;
sourceTree = "<group>";
};
EF8EF8F41C284680006C7B1B /* mindmachine */ = {
isa = PBXGroup;
children = (
EF8EF8F51C284680006C7B1B /* mindmachine.cpp */,
EF8EF8F61C284680006C7B1B /* mindmachine.h */,
);
path = mindmachine;
sourceTree = "<group>";
};
FA361F421C18862D00F197F3 /* veraMolnarLines68 */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1527,6 +1540,7 @@
D39F0DF71C222065004DEAAB /* OscOutboundPacketStream.cpp in Sources */,
B00CD10E1C21E81400C529FA /* ofxTween.cpp in Sources */,
FA361F491C1887A400F197F3 /* alexGifPaletteDitherMenkman.cpp in Sources */,
EF8EF8F71C284680006C7B1B /* mindmachine.cpp in Sources */,
9237CB9D1C11E9BD0007A916 /* veraFscene.cpp in Sources */,
85B3DCA81C1E47060054975A /* yeseulMenkmanInstitution.cpp in Sources */,
B00CD1041C21E81400C529FA /* ofxEasingBounce.cpp in Sources */,
Expand Down
31 changes: 31 additions & 0 deletions src/scenes/mindmachine/mindmachine.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

#include "mindmachine.h"

void mindmachine::setup(){

freq.set("Brain Frequency", 5, 1, 20);
parameters.add(freq);

flip = 1;

setOriginalArtist("William Grey Walter");
setAuthor("Christopher Pietsch");

loadCode("scenes/mindmachine/exampleCode.cpp");
}

void mindmachine::update(){

}

void mindmachine::draw(){
int microsePerWave = (int)( 1000*1000 / ( freq *2 ));
int wave = ofGetElapsedTimeMicros() / microsePerWave;
int lastWave = last / microsePerWave;
last = ofGetElapsedTimeMicros();

if(wave > lastWave) flip *= -1;
int alpha = ofMap(flip, -1, 1, 0, 255);

ofBackground(alpha);
}
18 changes: 18 additions & 0 deletions src/scenes/mindmachine/mindmachine.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

#include "ofMain.h"
#include "baseScene.h"

class mindmachine : public baseScene {

public:

void setup();
void update();
void draw();

ofParameter<float> freq;

int last;
int flip;
};
4 changes: 3 additions & 1 deletion src/scenes/sceneManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include "sarahgpRileyCircle.h"
#include "mwalczykVeraSquares.h"
#include "yeseulRileyBrokencircle.h"
#include "mindmachine.h"

float baseScene::smoothingSpeed = 0.02;

Expand All @@ -70,7 +71,7 @@ sceneManager::~sceneManager(){
void sceneManager::setup(){

font.load("fonts/ProggySmall.fon", 8, false ,false, false, 0, 96);

scenes.push_back(new CooperBauhaus()); // this might make for a good start scene -Robby & Becca
scenes.push_back(new RileyArcsRoy());
scenes.push_back(new rachelScene());
Expand Down Expand Up @@ -116,6 +117,7 @@ void sceneManager::setup(){
scenes.push_back(new olegVeraV());
scenes.push_back(new sarahgpRileyCircle());
scenes.push_back(new mwalczykVeraSquares());
scenes.push_back(new mindmachine());

// Too slow
// scenes.push_back(new andyMenkmanTif());
Expand Down