1 #ifndef _ONSETDETECTOR_H_ 2 #define _ONSETDETECTOR_H_ 12 #include "detectorbank.h" 13 #include "detectorcache.h" 33 void analyse(std::vector<std::size_t> &onsets, result_t threshold);
48 std::unique_ptr<detectorcache::Producer>
p;
54 std::unique_ptr<detectorcache::DetectorCache>
cache;
62 std::pair<bool, std::size_t>
findExactTime(std::size_t incStart,
65 result_t
logResult(std::size_t channel, std::size_t idx);
66 std::ofstream logfile;
67 std::ofstream segfile;
void analyse(std::vector< std::size_t > &onsets, result_t threshold)
Analyse the input and return any onsets.
Use multiple detectors to find note onsets at given frequencies (with multithreading).
std::size_t end
Total number of samples in cache.
std::unique_ptr< detectorcache::DetectorCache > cache
DetectorCache from which to get abs(z) values.
result_t logResult(std::size_t channel, std::size_t idx)
Get item from DetectorCache and calculate log.
const std::size_t offset
Number of pad samples at beginning of input buffer.
result_t getSegAvg()
Get average of current segment.
std::size_t n
Current sample number.
const std::size_t chans
Number of channels.
const parameter_t sr
Sample rate.
const std::size_t num_segs
Number of segments to be stored.
std::pair< bool, std::size_t > findExactTime(std::size_t incStart, std::size_t incStop)
Verify or reject onsets found by analyse
OnsetDetector(DetectorBank &db, const std::size_t offset, std::string csvfile)
Construct an onset detector, given a DetectorBank.
const std::size_t seg_len
OnsetDetector and DetectorCache segment length.
DetectorBank & db
The DetectorBank which produces the results.
std::unique_ptr< detectorcache::Producer > p
DetectorCache Producer.