* Detection function fix (was losing crispness in transients)
This commit is contained in:
@@ -111,11 +111,7 @@ double
|
|||||||
CompoundAudioCurve::processFiltering(double percussive, double hf)
|
CompoundAudioCurve::processFiltering(double percussive, double hf)
|
||||||
{
|
{
|
||||||
if (m_type == PercussiveDetector) {
|
if (m_type == PercussiveDetector) {
|
||||||
if (percussive > 0.35) {
|
return percussive;
|
||||||
return 1.0;
|
|
||||||
} else {
|
|
||||||
return 0.0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double rv = 0.f;
|
double rv = 0.f;
|
||||||
@@ -138,16 +134,17 @@ CompoundAudioCurve::processFiltering(double percussive, double hf)
|
|||||||
result = hfDeriv - hfDerivFiltered;
|
result = hfDeriv - hfDerivFiltered;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_type != SoftDetector && percussive > 0.35 && hfExcess > 0.0) {
|
|
||||||
rv = 1.0;
|
|
||||||
m_risingCount = 0;
|
|
||||||
} else {
|
|
||||||
if (result < m_lastResult) {
|
if (result < m_lastResult) {
|
||||||
if (m_risingCount > 3 && m_lastResult > 0) rv = 0.5;
|
if (m_risingCount > 3 && m_lastResult > 0) rv = 0.5;
|
||||||
m_risingCount = 0;
|
m_risingCount = 0;
|
||||||
} else {
|
} else {
|
||||||
m_risingCount ++;
|
m_risingCount ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_type == CompoundDetector) {
|
||||||
|
if (percussive > 0.35 && percussive > rv) {
|
||||||
|
rv = percussive;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastResult = result;
|
m_lastResult = result;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_KISSFFT
|
#ifdef USE_KISSFFT
|
||||||
#include "kissfft/kiss_fftr.h"
|
#include "kissfft/kiss_fftr.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -80,6 +82,8 @@ namespace FFTs {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_FFTW3
|
#ifdef HAVE_FFTW3
|
||||||
|
|
||||||
// Define FFTW_DOUBLE_ONLY to make all uses of FFTW functions be
|
// Define FFTW_DOUBLE_ONLY to make all uses of FFTW functions be
|
||||||
@@ -1280,6 +1284,26 @@ FFT::FFT(int size, int debugLevel)
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
std::cerr << "FFT::FFT(" << size << "): WARNING: Selected implemention not available" << std::endl;
|
||||||
|
#ifdef USE_BUILTIN_FFT
|
||||||
|
d = new FFTs::D_Cross(size);
|
||||||
|
#else
|
||||||
|
std::cerr << "FFT::FFT(" << size << "): ERROR: Fallback implementation not available!" << std::endl;
|
||||||
|
abort();
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
std::cerr << "FFT::FFT(" << size << "): WARNING: Selected implemention not available" << std::endl;
|
||||||
|
#ifdef USE_BUILTIN_FFT
|
||||||
|
d = new FFTs::D_Cross(size);
|
||||||
|
#else
|
||||||
|
std::cerr << "FFT::FFT(" << size << "): ERROR: Fallback implementation not available!" << std::endl;
|
||||||
|
abort();
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
#ifdef USE_BUILTIN_FFT
|
#ifdef USE_BUILTIN_FFT
|
||||||
std::cerr << "FFT::FFT(" << size << "): WARNING: using slow built-in implementation" << std::endl;
|
std::cerr << "FFT::FFT(" << size << "): WARNING: using slow built-in implementation" << std::endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user