view src/AccompanimentSynchroniser.h @ 55:2eca10a31ae2

improving printing of information, looking at how tempo is modelled
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Mon, 10 Dec 2012 17:07:21 +0000
parents 5274e3b5479d
children
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;

	double speed, smoothedSpeedOutput;
	double movingAverageWeighting, difference;

private:
	

	ofxOscSender sender;
	void sendSpeed(double const& val);

};
#endif