Exemple #1
0
void ofxDaito::setup(string settings, bool verbose) {
	xml.setVerbose(verbose);
	if(xml.loadFile(settings)) {
		int receivers = xml.getNumTags("receiver");
		for(int i = 0; i < receivers; i++) {
			xml.pushTag("receiver", i);
			string host = xml.getValue("host", "localhost");
			int port = xml.getValue("port", 0);
			senders.push_back(ofxOscSender());
			senders.back().setup(host, port);
			cout << "Connected OSC to " << host << ":" << port << endl;
			xml.popTag();
		}
	} else {
		cout << "Couldn't load file " << settings << endl;
	}
}
Exemple #2
0
//
//  Particle.cpp
//  kinopulse
//
//  Created by Kelly Fox on 11/1/15.
//
//

#include "Particle.h"

int Particle::particleCounter = 0;
int Particle::triggerTimer = 2;
ofxOscSender Particle::sender = ofxOscSender();
static const int pitchClassData[] = {0, 1, 5, 7, 8};
const int* Particle::pitchClass = pitchClassData;

Particle::Particle(ofPoint _location, float _mass) {
    location.set(_location);
    acceleration.set(0, 0);
    velocity.set(ofRandom(-1, 1), ofRandom(-2, 2));
    
    n_id = ++particleCounter;
    mass = _mass;
    radius = ofRandom(16) + 14;
    pitch = n_id % 5;
    
    timer = 1 + ofRandom(1.5);
    timestamp = 0;
    
    isActive = false;
    isTriggered = false;