Mercurial > hg > multitrack-audio-matcher
annotate 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 |
rev | line source |
---|---|
andrew@16 | 1 /* |
andrew@16 | 2 * AccompanimentSynchroniser.h |
andrew@16 | 3 * MultipleAudioMathcher |
andrew@16 | 4 * |
andrew@16 | 5 * Created by Andrew on 06/02/2012. |
andrew@16 | 6 * Copyright 2012 QMUL. All rights reserved. |
andrew@16 | 7 * |
andrew@16 | 8 */ |
andrew@16 | 9 |
andrew@16 | 10 |
andrew@16 | 11 #ifndef ACCOMPANIMENT_SYNCHRONISER_H |
andrew@16 | 12 #define ACCOMPANIMENT_SYNCHRONISER_H |
andrew@16 | 13 |
andrew@16 | 14 #include "ofxOsc.h" |
andrew@16 | 15 #define HOST "localhost" |
andrew@16 | 16 #define SENDER_PORT 10875 |
andrew@16 | 17 |
andrew@16 | 18 #include "ofMain.h" |
andrew@16 | 19 |
andrew@16 | 20 |
andrew@16 | 21 class AccompanimentSynchroniser{ |
andrew@16 | 22 |
andrew@16 | 23 public: |
andrew@16 | 24 AccompanimentSynchroniser(); |
andrew@16 | 25 |
andrew@16 | 26 void setPlayingRatio(const double& ratio, const double& timePlayed); |
andrew@16 | 27 void setRecordedPosition(); |
andrew@16 | 28 void updateRecordedPosition(const double& currentAlignmentPosition); |
andrew@16 | 29 |
andrew@16 | 30 void updateOutputSpeed(); |
andrew@16 | 31 |
andrew@16 | 32 double fileLengthSamples; |
andrew@16 | 33 |
andrew@16 | 34 |
andrew@16 | 35 |
andrew@16 | 36 double playingPositionRatio; |
andrew@16 | 37 double playingPositionSamples; |
andrew@16 | 38 double playingPositionMillis; |
andrew@16 | 39 double playingPositionTimeSent; |
andrew@16 | 40 |
andrew@16 | 41 private: |
andrew@16 | 42 |
andrew@16 | 43 double recordedPositionMillis; |
andrew@16 | 44 |
andrew@16 | 45 double speed; |
andrew@16 | 46 |
andrew@16 | 47 ofxOscSender sender; |
andrew@16 | 48 void sendSpeed(double const& val); |
andrew@16 | 49 |
andrew@16 | 50 }; |
andrew@16 | 51 #endif |