Mercurial > hg > precise-onset-detection
annotate ofxPreciseOnsetDetectorOffline/PreciseBassOnsetDetectorOffline.h @ 8:184a7c232049 tip
changed files since updating computer
author | Venetian |
---|---|
date | Thu, 14 Aug 2014 17:53:57 +0100 |
parents | b1c13e8bec26 |
children |
rev | line source |
---|---|
Venetian@7 | 1 /* |
Venetian@7 | 2 * PreciseBassOnsetDetectorOffline.h |
Venetian@7 | 3 * BasslinePrediction |
Venetian@7 | 4 * |
Venetian@7 | 5 * Created by Andrew N Robertson on 11/04/2014. |
Venetian@7 | 6 * Copyright 2014 QMUL. All rights reserved. |
Venetian@7 | 7 * |
Venetian@7 | 8 */ |
Venetian@7 | 9 |
Venetian@7 | 10 #ifndef PRECISE_BASS_DETECTOR_OFFLINE |
Venetian@7 | 11 #define PRECISE_BASS_DETECTOR_OFFLINE |
Venetian@7 | 12 |
Venetian@7 | 13 #include "PreciseOnsetDetectorOffline.h" |
Venetian@7 | 14 #include "YuleBrinner.h" |
Venetian@7 | 15 |
Venetian@7 | 16 //here qwe extend the usual precise onset detector to run different process functin that will log |
Venetian@7 | 17 //the pitches of bass onsets using pyin |
Venetian@7 | 18 |
Venetian@7 | 19 // |
Venetian@7 | 20 class PreciseBassOnsetDetectorOffline : public PreciseOnsetDetectorOffline{ |
Venetian@7 | 21 public: |
Venetian@7 | 22 //this version we will also try and detect pitch |
Venetian@7 | 23 int processAudioFileForBeatTimes(std::string audiofile); |
Venetian@7 | 24 |
Venetian@7 | 25 void processYinAudio(float* frame, int blocksize); |
Venetian@7 | 26 |
Venetian@7 | 27 |
Venetian@7 | 28 void processBassPitches(); |
Venetian@7 | 29 |
Venetian@7 | 30 void setMidiNoteString(int index, float midiPitch); |
Venetian@7 | 31 |
Venetian@7 | 32 void printOnsetLocations(); |
Venetian@7 | 33 void printPitchInfo(); |
Venetian@7 | 34 |
Venetian@7 | 35 //void categoriseOnsets(std::vector<double> beatTimes); |
Venetian@7 | 36 //void doCorrection(int& beattype, int& beatPosition); |
Venetian@7 | 37 |
Venetian@7 | 38 void predictionProcess(); |
Venetian@7 | 39 int getOptimalLag(); |
Venetian@7 | 40 |
Venetian@7 | 41 double quantisedCorrelation(int lag); |
Venetian@7 | 42 int getOnsetAtBeat(int tmpIndex, int beatPosition, int beatType, int& midiPitch); |
Venetian@7 | 43 void checkPrediction(int lag); |
Venetian@7 | 44 void checkPredictionFirstOrderMarkovCorrect(int lag); |
Venetian@7 | 45 |
Venetian@7 | 46 void checkBars(); |
Venetian@7 | 47 |
Venetian@7 | 48 |
Venetian@7 | 49 |
Venetian@7 | 50 YuleBrinner yule; |
Venetian@7 | 51 |
Venetian@7 | 52 }; |
Venetian@7 | 53 #endif |