view src/AccompanimentSynchroniser.h @ 39:f5de07b4d733

helped the tempo prior to have wider shape
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Tue, 24 Apr 2012 23:57:10 +0100
parents c96b18dd0f48
children 5274e3b5479d
line wrap: on
line source
/*
 *  AccompanimentSynchroniser.h
 *  MultipleAudioMathcher
 *
 *  Created by Andrew on 06/02/2012.
 *  Copyright 2012 QMUL. All rights reserved.
 *
 */


#ifndef ACCOMPANIMENT_SYNCHRONISER_H
#define ACCOMPANIMENT_SYNCHRONISER_H

#include "ofxOsc.h"
#define HOST "localhost"
#define SENDER_PORT 10875

#include "ofMain.h"


class AccompanimentSynchroniser{
	
public:
	AccompanimentSynchroniser();
	
	void reset();
	
	void setPlayingRatio(const double& ratio, const double& timePlayed);
	void setRecordedPosition();
	void updateRecordedPosition(const double& currentAlignmentPosition, const double& timeSent);
	
	void updateOutputSpeed();
	
	int counter ;
	
	double fileLengthSamples;
	

	
	double playingPositionRatio;
	double playingPositionSamples;
	double playingPositionMillis;
	double playingPositionTimeSent;
	
	double recordedPositionMillis;
	double recordedPositionTimeSent;
private:
	
	
	
	
	double speed;
	
	ofxOscSender sender;
	void sendSpeed(double const& val);

};
#endif