Revision 35:2f5b169e4a3b NoteHypothesis.h
| NoteHypothesis.h | ||
|---|---|---|
| 4 | 4 |
#ifndef _NOTE_HYPOTHESIS_H_ |
| 5 | 5 |
#define _NOTE_HYPOTHESIS_H_ |
| 6 | 6 |
|
| 7 |
#include "base/RealTime.h"
|
|
| 7 |
#include "vamp-sdk/RealTime.h"
|
|
| 8 | 8 |
#include <vector> |
| 9 | 9 |
|
| 10 |
namespace Turbot {
|
|
| 11 |
|
|
| 12 | 10 |
/** |
| 13 | 11 |
* An agent used to test an incoming series of instantaneous pitch |
| 14 | 12 |
* estimates to see whether they fit a consistent single-note |
| ... | ... | |
| 50 | 48 |
|
| 51 | 49 |
struct Estimate {
|
| 52 | 50 |
Estimate() : freq(0), time(), confidence(0) { }
|
| 53 |
Estimate(double _f, RealTime _t, double _c) : |
|
| 51 |
Estimate(double _f, Vamp::RealTime _t, double _c) :
|
|
| 54 | 52 |
freq(_f), time(_t), confidence(_c) { }
|
| 55 | 53 |
bool operator==(const Estimate &e) const {
|
| 56 | 54 |
return e.freq == freq && e.time == time && e.confidence == confidence; |
| 57 | 55 |
} |
| 58 | 56 |
double freq; |
| 59 |
RealTime time;
|
|
| 57 |
Vamp::RealTime time;
|
|
| 60 | 58 |
double confidence; |
| 61 | 59 |
}; |
| 62 | 60 |
typedef std::vector<Estimate> Estimates; |
| ... | ... | |
| 83 | 81 |
|
| 84 | 82 |
struct Note {
|
| 85 | 83 |
Note() : freq(0), time(), duration() { }
|
| 86 |
Note(double _f, RealTime _t, RealTime _d) :
|
|
| 84 |
Note(double _f, Vamp::RealTime _t, Vamp::RealTime _d) :
|
|
| 87 | 85 |
freq(_f), time(_t), duration(_d) { }
|
| 88 | 86 |
bool operator==(const Note &e) const {
|
| 89 | 87 |
return e.freq == freq && e.time == time && e.duration == duration; |
| 90 | 88 |
} |
| 91 | 89 |
double freq; |
| 92 |
RealTime time; |
|
| 93 |
RealTime duration; |
|
| 90 |
Vamp::RealTime time;
|
|
| 91 |
Vamp::RealTime duration;
|
|
| 94 | 92 |
}; |
| 95 | 93 |
|
| 96 | 94 |
/** |
| ... | ... | |
| 112 | 110 |
Estimates m_pending; |
| 113 | 111 |
}; |
| 114 | 112 |
|
| 115 |
} |
|
| 116 |
|
|
| 117 | 113 |
#endif |
Also available in: Unified diff