diff src/AccompanimentSynchroniser.h @ 16:680ba08e9925

Auto synchroniser added using the elastique~ object in max
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Mon, 06 Feb 2012 12:18:40 +0000
parents
children c96b18dd0f48
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/AccompanimentSynchroniser.h	Mon Feb 06 12:18:40 2012 +0000
@@ -0,0 +1,51 @@
+/*
+ *  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 setPlayingRatio(const double& ratio, const double& timePlayed);
+	void setRecordedPosition();
+	void updateRecordedPosition(const double& currentAlignmentPosition);
+	
+	void updateOutputSpeed();
+	
+	double fileLengthSamples;
+	
+
+	
+	double playingPositionRatio;
+	double playingPositionSamples;
+	double playingPositionMillis;
+	double playingPositionTimeSent;
+	
+private:
+	
+	double recordedPositionMillis;
+	
+	double speed;
+	
+	ofxOscSender sender;
+	void sendSpeed(double const& val);
+
+};
+#endif