This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Sequencer::setup(unsigned int length, int pulse, float _radius, int mode){ | |
angle = 360.f / (float)length; | |
seq_len = length; | |
radius = _radius; | |
nrCircle = 1; | |
angleStep = 360 / nrCircle; | |
Bjorklund::setup(length, pulse); | |
iter(); | |
//init array | |
steps.clear(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ofApp::update(){ | |
vector<ofPoint>steps; | |
ofMesh innerPoly; | |
ofPolyline clock; | |
centre = ofVec2f(posX, posY);//set the centre position of all vertices | |
//updating all position of steps | |
for(int i = 0; i < seq_len; i++){ //do iteration for all elements of sequence(seq_len) | |
steps.insert(steps.begin()+i, ofVec2f(centre.x + radius * cos(angle*i*PI/180),centre.y + radius * sin(angle*i*PI/180))); | |
//gets circles coordinates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ofApp::update(){ | |
//Test Drawing | |
if(bEuclid == true){//when sequencer triggers. | |
//add vertex values randomly. | |
for(int i=0; i < seq_len;i++){ | |
verts[i] = ofPoint (ofRandom(0, ofGetWidth()/2), ofRandom(0, ofGetHeight()/2),ofRandom(-25,25)); | |
mesh.addVertices(verts); | |
mesh.addTriangle(3, 2, 0); | |
mesh.addTriangle(3, 1, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// simpleSphere.cpp | |
// Processing-like 3D primitive-based particle class. | |
// Created by UNO H | |
// | |
// | |
#include "simpleSphere.h" | |
simpleSphere::simpleSphere(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofMain.h" | |
class ofxMeshFont2D :public ofTrueTypeFont{ | |
public: | |
void loadFont(string file, int size){ | |
ofTrueTypeFont::load(file, size,true,true,true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-------------------------------------------------------------- | |
void testApp::draw(){ | |
glEnable(GL_DEPTH_TEST); | |
ofEnableLighting(); | |
ofLight light; | |
light.setPosition(ofPoint(-200,0, -1000)); | |
light.lookAt( ofPoint(-1000,0,0)); | |
light.setDirectional(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "InfinitySeries.hpp" | |
void InfinitySeries::generate(int size){ | |
series.assign(size,0);//populate array first | |
index = 0; //set index for the array. | |
//start from fundamental. numbers only shows the relative relationships(interval) but absolute relationship. | |
do{ | |
//first two step. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ofApp::GCD(int first, int second){ | |
//Euclid Algorithm : finding the greatest common divisor. | |
//first, we need to figure out which number is the greatest common divisor. | |
//Debug function : we can see values with this bool. | |
bool print = true; | |
int gcd;//create int for GCD. | |
int iter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Bjorklund.h" | |
//Edited NoisyLittleBurger's Bjorklund Algorithm in C | |
//http://www.noisylittlebugger.net/diy/bjorklund/Bjorklund_Working_Final/Bjorklund_algorithm_arduino.txt | |
//CHANGED : | |
//1. use dynamic array. | |
//2. fixed sequence's off-spot problem | |
//3. added Explanation about Algorithm based on G.Touissant's Paper, | |
//"The Euclidean Algorithm Generates Traditional Musical Rhythms" | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ofApp::newMidiMessage(ofxMidiMessage& msg) { | |
//RtMidi Callback. | |
// make a copy of the latest message | |
midiMessage = msg; | |
//ASSIGNING NEW ENUMS FOR M-Audio Keystation 32---------------------------------- |
NewerOlder