comparison BeatRootProcessor.h @ 23:633ec097fa56

Expose the processing parameters Simon suggests
author Chris Cannam
date Tue, 03 Sep 2013 17:32:09 +0100
parents 6afcb5edd7ab
children 3a5840de4d5f
comparison
equal deleted inserted replaced
22:6afcb5edd7ab 23:633ec097fa56
79 * detection function(s). */ 79 * detection function(s). */
80 vector<double> onsets; 80 vector<double> onsets;
81 81
82 /** The estimated onset times and their saliences. */ 82 /** The estimated onset times and their saliences. */
83 EventList onsetList; 83 EventList onsetList;
84
85 /** User-specifiable processing parameters. */
86 AgentParameters agentParameters;
84 87
85 /** Flag for suppressing all standard output messages except results. */ 88 /** Flag for suppressing all standard output messages except results. */
86 static bool silent; 89 static bool silent;
87 90
88 public: 91 public:
89 92
90 /** Constructor: note that streams are not opened until the input 93 /** Constructor: note that streams are not opened until the input
91 * file is set (see <code>setInputFile()</code>). */ 94 * file is set (see <code>setInputFile()</code>). */
92 BeatRootProcessor(float sr) : 95 BeatRootProcessor(float sr, AgentParameters parameters) :
93 sampleRate(sr) { 96 sampleRate(sr),
94 hopSize = 0; 97 hopSize(0),
95 fftSize = 0; 98 fftSize(0),
96 hopTime = 0.010; 99 hopTime(0.010),
97 fftTime = 0.04644; 100 fftTime(0.04644),
101 agentParameters(parameters)
102 {
98 hopSize = lrint(sampleRate * hopTime); 103 hopSize = lrint(sampleRate * hopTime);
99 fftSize = lrint(pow(2, lrint( log(fftTime * sampleRate) / log(2)))); 104 fftSize = lrint(pow(2, lrint( log(fftTime * sampleRate) / log(2))));
100 } // constructor 105 } // constructor
101 106
102 void reset() { 107 void reset() {