Mercurial > hg > match-vamp
comparison src/MatchVampPlugin.cpp @ 151:246de093f0f1 refactors
Make noise an option in the plugin: on by default, and therefore also switch on silence by default
author | Chris Cannam |
---|---|
date | Fri, 23 Jan 2015 09:20:04 +0000 |
parents | 6914a6a01ffc |
children | fcf0dd0166b1 d6df9fe7b12f |
comparison
equal
deleted
inserted
replaced
150:b79151bb75af | 151:246de093f0f1 |
---|---|
211 desc.description = "Total frame energy threshold below which a feature will be regarded as silent"; | 211 desc.description = "Total frame energy threshold below which a feature will be regarded as silent"; |
212 desc.minValue = 0; | 212 desc.minValue = 0; |
213 desc.maxValue = 1; | 213 desc.maxValue = 1; |
214 desc.defaultValue = m_defaultFcParams.silenceThreshold; | 214 desc.defaultValue = m_defaultFcParams.silenceThreshold; |
215 desc.isQuantized = false; | 215 desc.isQuantized = false; |
216 list.push_back(desc); | |
217 | |
218 desc.identifier = "noise"; | |
219 desc.name = "Mix in Noise"; | |
220 desc.description = "Whether to mix in a small constant white noise term when calculating feature distance. This can improve alignment against sources containing cleanly synthesised audio."; | |
221 desc.minValue = 0; | |
222 desc.maxValue = 1; | |
223 desc.defaultValue = (int)m_defaultDParams.noise; | |
224 desc.isQuantized = true; | |
225 desc.quantizeStep = 1; | |
216 list.push_back(desc); | 226 list.push_back(desc); |
217 | 227 |
218 desc.identifier = "gradientlimit"; | 228 desc.identifier = "gradientlimit"; |
219 desc.name = "Gradient Limit"; | 229 desc.name = "Gradient Limit"; |
220 desc.description = "Limit of number of frames that will be accepted from one source without a frame from the other source being accepted"; | 230 desc.description = "Limit of number of frames that will be accepted from one source without a frame from the other source being accepted"; |
281 return (float)m_params.blockTime; | 291 return (float)m_params.blockTime; |
282 } else if (name == "smooth") { | 292 } else if (name == "smooth") { |
283 return m_smooth ? 1.0 : 0.0; | 293 return m_smooth ? 1.0 : 0.0; |
284 } else if (name == "silencethreshold") { | 294 } else if (name == "silencethreshold") { |
285 return m_fcParams.silenceThreshold; | 295 return m_fcParams.silenceThreshold; |
296 } else if (name == "noise") { | |
297 return m_dParams.noise; | |
286 } | 298 } |
287 | 299 |
288 return 0.0; | 300 return 0.0; |
289 } | 301 } |
290 | 302 |
309 m_params.blockTime = value; | 321 m_params.blockTime = value; |
310 } else if (name == "smooth") { | 322 } else if (name == "smooth") { |
311 m_smooth = (value > 0.5); | 323 m_smooth = (value > 0.5); |
312 } else if (name == "silencethreshold") { | 324 } else if (name == "silencethreshold") { |
313 m_fcParams.silenceThreshold = value; | 325 m_fcParams.silenceThreshold = value; |
326 } else if (name == "noise") { | |
327 m_dParams.noise = (DistanceMetric::NoiseAddition)(int(value + 0.1)); | |
314 } | 328 } |
315 } | 329 } |
316 | 330 |
317 size_t | 331 size_t |
318 MatchVampPlugin::getPreferredStepSize() const | 332 MatchVampPlugin::getPreferredStepSize() const |