From 90c316f66baeecd2b7984ca4daa0ed2b1087001f Mon Sep 17 00:00:00 2001 From: Xavier Lizarraga Date: Tue, 19 Sep 2023 16:07:13 +0200 Subject: [PATCH 1/3] Fix issue in PitchYINFFT when no peaks were found by PeakDetection. --- src/algorithms/tonal/pitchyinfft.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tonal/pitchyinfft.cpp b/src/algorithms/tonal/pitchyinfft.cpp index 5defae5f8..27cca172c 100644 --- a/src/algorithms/tonal/pitchyinfft.cpp +++ b/src/algorithms/tonal/pitchyinfft.cpp @@ -189,8 +189,9 @@ void PitchYinFFT::compute() { yinMin = -_amplitudes[0]; } else { - // TODO this should never happen, but some people reported it happening in their real time applications. - throw EssentiaException("PitchYinFFT: it appears that no peaks were found by PeakDetection. If you read this message, PLEASE, report this issue to the developers with an example of audio on which it happened."); + tau = 0.0; // it will provide zero-pitch and zero-pitch confidence. + // launch warning message for user feedbacking + E_WARNING("PitchYinFFT: it appears that no peaks were found by PeakDetection algorithm. So, pitch and confidence will be set to zero."); } } else { From 043df33f28bbb57694cba2c799ee13e1a6b0ac19 Mon Sep 17 00:00:00 2001 From: Xavier Lizarraga Date: Tue, 19 Sep 2023 16:41:42 +0200 Subject: [PATCH 2/3] Revert "Fix issue in PitchYINFFT when no peaks were found by PeakDetection." This reverts commit 90c316f66baeecd2b7984ca4daa0ed2b1087001f. --- src/algorithms/tonal/pitchyinfft.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/algorithms/tonal/pitchyinfft.cpp b/src/algorithms/tonal/pitchyinfft.cpp index 27cca172c..5defae5f8 100644 --- a/src/algorithms/tonal/pitchyinfft.cpp +++ b/src/algorithms/tonal/pitchyinfft.cpp @@ -189,9 +189,8 @@ void PitchYinFFT::compute() { yinMin = -_amplitudes[0]; } else { - tau = 0.0; // it will provide zero-pitch and zero-pitch confidence. - // launch warning message for user feedbacking - E_WARNING("PitchYinFFT: it appears that no peaks were found by PeakDetection algorithm. So, pitch and confidence will be set to zero."); + // TODO this should never happen, but some people reported it happening in their real time applications. + throw EssentiaException("PitchYinFFT: it appears that no peaks were found by PeakDetection. If you read this message, PLEASE, report this issue to the developers with an example of audio on which it happened."); } } else { From ee31729b384f1f79eb418f6213d6b24d89981bfe Mon Sep 17 00:00:00 2001 From: Xavier Lizarraga Date: Tue, 19 Sep 2023 16:47:59 +0200 Subject: [PATCH 3/3] Fix issue in PitchYINFFT when no peaks were found by PeakDetection. --- src/algorithms/tonal/pitchyinfft.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tonal/pitchyinfft.cpp b/src/algorithms/tonal/pitchyinfft.cpp index 5defae5f8..27cca172c 100644 --- a/src/algorithms/tonal/pitchyinfft.cpp +++ b/src/algorithms/tonal/pitchyinfft.cpp @@ -189,8 +189,9 @@ void PitchYinFFT::compute() { yinMin = -_amplitudes[0]; } else { - // TODO this should never happen, but some people reported it happening in their real time applications. - throw EssentiaException("PitchYinFFT: it appears that no peaks were found by PeakDetection. If you read this message, PLEASE, report this issue to the developers with an example of audio on which it happened."); + tau = 0.0; // it will provide zero-pitch and zero-pitch confidence. + // launch warning message for user feedbacking + E_WARNING("PitchYinFFT: it appears that no peaks were found by PeakDetection algorithm. So, pitch and confidence will be set to zero."); } } else {