Mercurial > hg > multitrack-audio-matcher
diff src/AudioEventMatcher.h @ 32:4be22a1a0e24
added in chroma comparison for fourth channel (guitar)
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Mon, 02 Apr 2012 17:19:22 +0100 |
parents | 24c413f0f2c5 |
children | 6fb77b20413c |
line wrap: on
line diff
--- a/src/AudioEventMatcher.h Sun Apr 01 01:33:23 2012 +0100 +++ b/src/AudioEventMatcher.h Mon Apr 02 17:19:22 2012 +0100 @@ -12,7 +12,7 @@ #ifndef AUDIO_EVENT_MATCHER_H #define AUDIO_EVENT_MATCHER_H -#define NUMBER_OF_CHANNELS 3 + #include "ofMain.h" #include "ChromaOnset.h" @@ -24,6 +24,8 @@ #include "AccompanimentSynchroniser.h" #include "TempoFollower.h" +static const int numberOfChannels = 4; + class AudioEventMatcher{ public: @@ -35,7 +37,11 @@ void updateBestAlignmentPosition(); void draw(); - void drawBayesianDistributions();; + void drawBayesianDistributions(); + void drawPositionWindow(); + void drawTrackLikelihoods(); + void drawInfo(); + void setWindowDimensions(); void newPitchEvent(const int& channel, const double& pitchIn, const double& timeIn); @@ -44,8 +50,13 @@ void newSnareEvent(const double& timeIn); void newSnareEvent(const int& channel, const double& timeIn); + void newChromaEvent(const int& channel, float* chromaIn, const double& timeIn); + + void matchNewPitchEvent(const int& channel, const double& pitchIn, const double& timeIn); void matchNewOnsetEvent(const int& channel, const double& timeIn); + void matchNewChromaEvent(const int& channel, float* chroma, const double& timeIn); + double getChromaDistance(float* chromaOne, float* chromaTwo); BayesianArrayStructure bayesianStruct;//hold the probability distriubtions @@ -70,15 +81,15 @@ bool usingRealTime; double recentPitch, recentTime; - DynamicVector likelihoodVisualisation[NUMBER_OF_CHANNELS]; - DynamicVector recentPriors[NUMBER_OF_CHANNELS]; + DynamicVector likelihoodVisualisation[numberOfChannels]; + DynamicVector recentPriors[numberOfChannels]; //DynamicVector recentPrior; DynamicVector projectedPrior; double currentAlignmentPosition; double lastAlignmentTime; - double recentEventTime[NUMBER_OF_CHANNELS]; + double recentEventTime[numberOfChannels]; int startTime; int currentAlignmentTime; @@ -92,11 +103,12 @@ double onsetLikelihoodWidth; double onsetLikelihoodToNoise; double pitchLikelihoodToNoise;//more noise + double chromaLikelihoodToNoise; double pitchOfNearestMatch;//for viz purposes double distanceOfNearestMatch; - + double chromaLikelihoodWidth; TempoFollower temporal; TempoFollower recordedTempoData;