annotate src/AudioEventMatcher.h @ 15:780def3a1f36

Changed to have any definition - re midi matcher bug fix - and bringing in start and stop functions
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Sun, 05 Feb 2012 22:08:50 +0000
parents 0a52258accec
children 680ba08e9925
rev   line source
andrew@0 1 /*
andrew@0 2 * AudioEventMatcher.h
andrew@0 3 * MultipleAudioMathcher
andrew@0 4 *
andrew@0 5 * Created by Andrew on 31/01/2012.
andrew@0 6 * Copyright 2012 QMUL. All rights reserved.
andrew@0 7 *
andrew@0 8 */
andrew@0 9
andrew@0 10
andrew@0 11
andrew@0 12 #ifndef AUDIO_EVENT_MATCHER_H
andrew@0 13 #define AUDIO_EVENT_MATCHER_H
andrew@0 14
andrew@0 15
andrew@0 16 #include "ofMain.h"
andrew@0 17 #include "ChromaOnset.h"
andrew@0 18 #include "LiveAudioInput.h"
andrew@0 19 #include "ofxWindowRegion.h"
andrew@0 20 #include "BayesianArrayStructure.h"
andrew@1 21 #include "RecordedMultitrackAudio.h"
andrew@7 22 #include "DynamicVector.h"
andrew@0 23
andrew@0 24 class AudioEventMatcher{
andrew@0 25
andrew@0 26 public:
andrew@0 27 AudioEventMatcher();
andrew@0 28
andrew@0 29 void setArraySizes();
andrew@0 30
andrew@9 31 void updatePosition();
andrew@8 32 void updateBestAlignmentPosition();
andrew@8 33
andrew@0 34 void draw();
andrew@6 35 void drawBayesianDistributions();;
andrew@7 36 void setWindowDimensions();
andrew@0 37
andrew@6 38 void newPitchEvent(const int& channel, const double& pitchIn, const double& timeIn);
andrew@2 39 void newKickEvent(const double& timeIn);
andrew@6 40 void newKickEvent(const int& channel, const double& timeIn);
andrew@2 41 void newSnareEvent(const double& timeIn);
andrew@7 42 void newSnareEvent(const int& channel, const double& timeIn);
andrew@2 43
andrew@2 44 void matchNewPitchEvent(const int& channel, const double& pitchIn, const double& timeIn);
andrew@2 45 void matchNewOnsetEvent(const int& channel, const double& timeIn);
andrew@1 46
andrew@0 47 BayesianArrayStructure bayesianStruct;//hold the probability distriubtions
andrew@0 48
andrew@0 49 LiveAudioInput liveInput;//hold the new events that come in
andrew@1 50 RecordedMultitrackAudio recordedTracks;
andrew@1 51
andrew@1 52 void windowResized(const int& w, const int& h);
andrew@0 53
andrew@0 54 ofxWindowRegion bayesTempoWindow;
andrew@3 55 ofxWindowRegion bayesPositionWindow;
andrew@3 56 ofxWindowRegion bayesLikelihoodWindow;
andrew@0 57
andrew@3 58 bool checkMatch(const double& recordedPitch, const double& livePitch);
andrew@3 59 double getPitchDistance(const double& pitchOne, const double& pitchTwo, const double& scale);
andrew@3 60
andrew@3 61 void startPlaying();
andrew@15 62 void stopPlaying();
andrew@15 63 bool startedPlaying;
andrew@3 64
andrew@3 65 bool usingRealTime;
andrew@7 66 double recentPitch, recentTime;
andrew@7 67
andrew@7 68 DynamicVector likelihoodVisualisation[3];
andrew@11 69 DynamicVector recentPriors[3];
andrew@13 70 //DynamicVector recentPrior;
andrew@10 71 DynamicVector projectedPrior;
andrew@8 72
andrew@8 73 double currentAlignmentPosition;
andrew@8 74 double lastAlignmentTime;
andrew@8 75
andrew@8 76 double recentEventTime[3];
andrew@10 77 int startTime;
andrew@11 78 int currentAlignmentTime;
andrew@9 79
andrew@9 80 double screenStartTimeMillis, screenEndTimeMillis, screenWidthMillis;
andrew@9 81 bool followingLiveInput;
andrew@9 82 void setScreenDisplayTimes();
andrew@14 83
andrew@14 84 //params
andrew@14 85 double onsetLikelihoodWidth;
andrew@15 86 double onsetLikelihoodToNoise;
andrew@15 87 double pitchLikelihoodToNoise;//more noise
andrew@0 88 };
andrew@0 89 #endif