Venetian@7: /* Venetian@7: * PreciseBassOnsetDetectorOffline.h Venetian@7: * BasslinePrediction Venetian@7: * Venetian@7: * Created by Andrew N Robertson on 11/04/2014. Venetian@7: * Copyright 2014 QMUL. All rights reserved. Venetian@7: * Venetian@7: */ Venetian@7: Venetian@7: #ifndef PRECISE_BASS_DETECTOR_OFFLINE Venetian@7: #define PRECISE_BASS_DETECTOR_OFFLINE Venetian@7: Venetian@7: #include "PreciseOnsetDetectorOffline.h" Venetian@7: #include "YuleBrinner.h" Venetian@7: Venetian@7: //here qwe extend the usual precise onset detector to run different process functin that will log Venetian@7: //the pitches of bass onsets using pyin Venetian@7: Venetian@7: // Venetian@7: class PreciseBassOnsetDetectorOffline : public PreciseOnsetDetectorOffline{ Venetian@7: public: Venetian@7: //this version we will also try and detect pitch Venetian@7: int processAudioFileForBeatTimes(std::string audiofile); Venetian@7: Venetian@7: void processYinAudio(float* frame, int blocksize); Venetian@7: Venetian@7: Venetian@7: void processBassPitches(); Venetian@7: Venetian@7: void setMidiNoteString(int index, float midiPitch); Venetian@7: Venetian@7: void printOnsetLocations(); Venetian@7: void printPitchInfo(); Venetian@7: Venetian@7: //void categoriseOnsets(std::vector beatTimes); Venetian@7: //void doCorrection(int& beattype, int& beatPosition); Venetian@7: Venetian@7: void predictionProcess(); Venetian@7: int getOptimalLag(); Venetian@7: Venetian@7: double quantisedCorrelation(int lag); Venetian@7: int getOnsetAtBeat(int tmpIndex, int beatPosition, int beatType, int& midiPitch); Venetian@7: void checkPrediction(int lag); Venetian@7: void checkPredictionFirstOrderMarkovCorrect(int lag); Venetian@7: Venetian@7: void checkBars(); Venetian@7: Venetian@7: Venetian@7: Venetian@7: YuleBrinner yule; Venetian@7: Venetian@7: }; Venetian@7: #endif