annotate src/AudioEventMatcher.h @ 3:5e188c0035b6

checking the offsets of the arrays
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Wed, 01 Feb 2012 16:05:26 +0000
parents 179c09199b3c
children 45b5cf9be377
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@0 22
andrew@0 23 class AudioEventMatcher{
andrew@0 24
andrew@0 25 public:
andrew@0 26 AudioEventMatcher();
andrew@0 27
andrew@0 28 void setArraySizes();
andrew@0 29
andrew@0 30 void draw();
andrew@0 31
andrew@1 32 void newPitchEvent(const double& pitchIn, const double& timeIn);
andrew@2 33 void newKickEvent(const double& timeIn);
andrew@2 34 void newSnareEvent(const double& timeIn);
andrew@2 35
andrew@2 36 void matchNewPitchEvent(const int& channel, const double& pitchIn, const double& timeIn);
andrew@2 37 void matchNewOnsetEvent(const int& channel, const double& timeIn);
andrew@1 38
andrew@0 39 BayesianArrayStructure bayesianStruct;//hold the probability distriubtions
andrew@0 40
andrew@0 41 LiveAudioInput liveInput;//hold the new events that come in
andrew@1 42 RecordedMultitrackAudio recordedTracks;
andrew@1 43
andrew@1 44 void windowResized(const int& w, const int& h);
andrew@0 45
andrew@0 46 ofxWindowRegion bayesTempoWindow;
andrew@3 47 ofxWindowRegion bayesPositionWindow;
andrew@3 48 ofxWindowRegion bayesLikelihoodWindow;
andrew@0 49
andrew@3 50 bool checkMatch(const double& recordedPitch, const double& livePitch);
andrew@3 51 double getPitchDistance(const double& pitchOne, const double& pitchTwo, const double& scale);
andrew@3 52
andrew@3 53 void updateBayesianDistributions(const double& newEventTime);
andrew@3 54 void startPlaying();
andrew@3 55
andrew@3 56 bool usingRealTime;
andrew@3 57
andrew@0 58 };
andrew@0 59 #endif