Mercurial > hg > midi-score-follower
comparison src/BayesianArrayStructure.h @ 2:5581023e0de4
Added separate CannamMidiFileLoader class to handle the loading in.
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Fri, 19 Aug 2011 01:26:40 +0100 |
parents | b299a65a3ad0 |
children | de86d77f2612 |
comparison
equal
deleted
inserted
replaced
1:1a32ce016bb9 | 2:5581023e0de4 |
---|---|
4 * | 4 * |
5 * Created by Andrew on 17/07/2011. | 5 * Created by Andrew on 17/07/2011. |
6 * Copyright 2011 QMUL. All rights reserved. | 6 * Copyright 2011 QMUL. All rights reserved. |
7 * | 7 * |
8 */ | 8 */ |
9 #ifndef BAYESIAN_ARRAY_STRUCTURE | |
10 #define BAYESIAN_ARRAY_STRUCTURE | |
11 | |
9 | 12 |
10 #include "ofMain.h" | 13 #include "ofMain.h" |
11 //#include "DynamicBayesianArray.h" | 14 //#include "DynamicBayesianArray.h" |
12 #include "DynamicVector.h" | 15 #include "DynamicVector.h" |
13 | 16 |
25 void drawTempoArrays(); | 28 void drawTempoArrays(); |
26 | 29 |
27 void resetSize(int length); | 30 void resetSize(int length); |
28 void resetArrays(); | 31 void resetArrays(); |
29 void simpleExample(); | 32 void simpleExample(); |
33 void setStartPlaying(); | |
34 void zeroArrays(); | |
30 | 35 |
31 double screenWidth; | 36 double screenWidth; |
32 | 37 |
33 void copyPriorToPosterior(); | 38 void copyPriorToPosterior(); |
34 // DynamicBayesianArray bayesArray; | 39 // DynamicBayesianArray bayesArray; |
35 | 40 |
36 double lastEventTime; | 41 double lastEventTime; |
42 double likelihoodNoise; | |
43 double speedLikelihoodNoise; | |
37 | 44 |
38 DynamicVector tmpPrior; | 45 DynamicVector tmpPrior; |
39 | 46 DynamicVector tmpPosteriorForStorage; |
40 DynamicVector prior; | 47 DynamicVector prior; |
41 DynamicVector posterior; | 48 DynamicVector posterior; |
42 DynamicVector likelihood; | 49 DynamicVector likelihood; |
43 | 50 |
44 DynamicVector relativeSpeedPrior; | 51 DynamicVector relativeSpeedPrior; |
45 DynamicVector relativeSpeedLikelihood; | 52 DynamicVector relativeSpeedLikelihood; |
46 DynamicVector relativeSpeedPosterior; | 53 DynamicVector relativeSpeedPosterior; |
47 DynamicVector acceleration; | 54 DynamicVector acceleration; |
48 | 55 |
56 double tmpBestEstimate; | |
57 void updateTmpBestEstimate(const double& timeDifference); | |
58 | |
59 int updateCounter; | |
60 | |
61 void setPositionDistributionScalar(double f); | |
62 | |
49 void resetSpeedToOne(); | 63 void resetSpeedToOne(); |
64 void addGaussianNoiseToSpeedPosterior(const double& std_dev); | |
65 void addTriangularNoiseToSpeedPosterior(const double& std_dev); | |
50 | 66 |
51 double bestEstimate; | 67 double bestEstimate; |
52 void updateBestEstimate(); | 68 void updateBestEstimate(); |
53 // double lastBestEstimateUpdateTime; | 69 double lastBestEstimateUpdateTime; |
54 | 70 |
55 double speedDecayWidth, speedDecayAmount; | 71 double speedDecayWidth, speedDecayAmount; |
56 void decaySpeedDistribution(double timeDifference); | 72 void decaySpeedDistribution(double timeDifference); |
57 | 73 |
58 void resetSpeedSize(int length); | 74 void resetSpeedSize(int length); |
67 void updateTempoLikelihood(const double& speedRatio, const double& matchFactor); | 83 void updateTempoLikelihood(const double& speedRatio, const double& matchFactor); |
68 | 84 |
69 void crossUpdateArrays(DynamicVector& position, DynamicVector& speed, double timeDifference); | 85 void crossUpdateArrays(DynamicVector& position, DynamicVector& speed, double timeDifference); |
70 | 86 |
71 }; | 87 }; |
72 | 88 #endif |