andrew@0: /* andrew@0: * AubioPitch.h andrew@0: * fileLoaderAndOnsetDetection andrew@0: * andrew@0: * Created by Andrew on 24/01/2012. andrew@0: * Copyright 2012 QMUL. All rights reserved. andrew@0: * andrew@0: */ andrew@0: andrew@0: andrew@0: #ifndef AUBIO_PITCH_H andrew@0: #define AUBIO_PITCH_H andrew@0: andrew@0: #include "ofMain.h" andrew@0: #include "aubio.h" andrew@0: andrew@0: class AubioPitch { andrew@0: public: andrew@0: AubioPitch(); andrew@0: ~AubioPitch(); andrew@0: andrew@0: bool processFrame(float* frame, int size); andrew@0: andrew@0: int bufsize, hopsize; andrew@0: andrew@0: aubio_pitchdetection_type type_pitch; andrew@0: aubio_pitchdetection_mode mode_pitch; andrew@0: andrew@0: andrew@0: float threshold; andrew@0: andrew@0: smpl_t pitch; andrew@0: andrew@0: aubio_pitchdetection_t *pitchDetect; andrew@0: fvec_t *vec; andrew@0: int pos; andrew@0: andrew@0: float doPitchDetection(float* frame, const int& length); andrew@0: andrew@0: float getPitch(); andrew@0: void addToBuffer(float* tmpFrame, const int& n); andrew@0: andrew@0: //float getPitchDetectedFromBuffer(float* frame, const int& length); andrew@0: andrew@0: }; andrew@0: #endif