comparison Tuning.cpp @ 59:1ccb883b585f matthiasm-plugin

more README and n3 updates; changed rollon parameter to percentage
author matthiasm
date Mon, 25 Oct 2010 23:47:06 +0900
parents 01bc078f5f61
children b8ffc98eda95
comparison
equal deleted inserted replaced
58:01bc078f5f61 59:1ccb883b585f
78 78
79 ParameterDescriptor d0; 79 ParameterDescriptor d0;
80 d0.identifier = "rollon"; 80 d0.identifier = "rollon";
81 d0.name = "spectral roll-on"; 81 d0.name = "spectral roll-on";
82 d0.description = "Consider the cumulative energy spectrum (from low to high frequencies). All bins below the first bin whose cumulative energy exceeds the quantile [spectral roll on] x [total energy] will be set to 0. A value of 0 means that no bins will be changed."; 82 d0.description = "Consider the cumulative energy spectrum (from low to high frequencies). All bins below the first bin whose cumulative energy exceeds the quantile [spectral roll on] x [total energy] will be set to 0. A value of 0 means that no bins will be changed.";
83 d0.unit = ""; 83 d0.unit = "%";
84 d0.minValue = 0; 84 d0.minValue = 0;
85 d0.maxValue = 0.05; 85 d0.maxValue = 5;
86 d0.defaultValue = 0; 86 d0.defaultValue = 0;
87 d0.isQuantized = true; 87 d0.isQuantized = true;
88 d0.quantizeStep = 0.005; 88 d0.quantizeStep = 0.5;
89 list.push_back(d0); 89 list.push_back(d0);
90 90
91 91
92 return list; 92 return list;
93 } 93 }
193 float meanTuningReal = m_meanTuning0 + cosvalue * m_meanTuning1 + cosvalue * m_meanTuning2; 193 float meanTuningReal = m_meanTuning0 + cosvalue * m_meanTuning1 + cosvalue * m_meanTuning2;
194 float cumulativetuning = 440 * pow(2,atan2(meanTuningImag, meanTuningReal)/(24*M_PI)); 194 float cumulativetuning = 440 * pow(2,atan2(meanTuningImag, meanTuningReal)/(24*M_PI));
195 195
196 char buffer0 [50]; 196 char buffer0 [50];
197 197
198 sprintf(buffer0, "estimated tuning: %0.1f Hz", cumulativetuning); 198 sprintf(buffer0, "%0.1f Hz", cumulativetuning);
199 199
200 // push tuning to FeatureSet fsOut 200 // push tuning to FeatureSet fsOut
201 Feature f0; // tuning 201 Feature f0; // tuning
202 f0.hasTimestamp = true; 202 f0.hasTimestamp = true;
203 f0.timestamp = Vamp::RealTime::frame2RealTime(0, lrintf(m_inputSampleRate));; 203 f0.timestamp = Vamp::RealTime::frame2RealTime(0, lrintf(m_inputSampleRate));
204 f0.values.push_back(cumulativetuning);
204 f0.label = buffer0; 205 f0.label = buffer0;
205 fsOut[m_outputTuning].push_back(f0); 206 fsOut[m_outputTuning].push_back(f0);
206 207
207 return fsOut; 208 return fsOut;
208 209