summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2019-05-11 01:54:43 +0200
committerDaniel Schürmann <daschuer@mixxx.org>2019-05-11 01:54:43 +0200
commitc2676d5c71e3e723d61cf7c15089e20496849b15 (patch)
tree6aaeab1d94b90625de0bbc9699f51b9083a4c73c /lib
parentf100ea90d6b6a7cc8b5ed468ce9667e1eee70e7a (diff)
Updated upstream patch
Diffstat (limited to 'lib')
-rw-r--r--lib/qm-dsp/key_rounding.patch54
1 files changed, 31 insertions, 23 deletions
diff --git a/lib/qm-dsp/key_rounding.patch b/lib/qm-dsp/key_rounding.patch
index 7f8cfd7540..dd1442e8d3 100644
--- a/lib/qm-dsp/key_rounding.patch
+++ b/lib/qm-dsp/key_rounding.patch
@@ -1,26 +1,34 @@
diff --git a/lib/qm-dsp/dsp/keydetection/GetKeyMode.cpp b/lib/qm-dsp/dsp/keydetection/GetKeyMode.cpp
-index cf3580e..bf72b21 100644
+index 55a1333..cf3580e 100644
--- a/lib/qm-dsp/dsp/keydetection/GetKeyMode.cpp
+++ b/lib/qm-dsp/dsp/keydetection/GetKeyMode.cpp
-@@ -182,7 +182,7 @@ int GetKeyMode::process(double *PCMData)
- // middle of its three bins :
- // Added 21.11.07 by Chris Sutton based on debugging with Katy
- // Noland + comparison with Matlab equivalent.
-- MathUtilities::circShift( m_ChrPointer, m_BPO, 1);
-+ MathUtilities::circShift( m_ChrPointer, m_BPO, 2);
- /*
- std::cout << "raw chroma: ";
- for (int ii = 0; ii < m_BPO; ++ii) {
-@@ -266,8 +266,10 @@ int GetKeyMode::process(double *PCMData)
- std::cout << std::endl;
- */
- double dummy;
-- // '1 +' because we number keys 1-24, not 0-23.
-- key = 1 + (int)ceil( (double)MathUtilities::getMax( m_Keys, 2* m_BPO, &dummy )/3 );
-+ // m_Keys[1] is C center 1 / 3 + 1 = 1
-+ // m_Keys[4] is D center 4 / 3 + 1 = 2
-+ // '+ 1' because we number keys 1-24, not 0-23.
-+ key = MathUtilities::getMax( m_Keys, 2* m_BPO, &dummy ) / 3 + 1;
-
- // std::cout << "key pre-sorting: " << key << std::endl;
-
+@@ -177,11 +177,12 @@ int GetKeyMode::process(double *PCMData)
+
+ m_ChrPointer = m_Chroma->process( m_DecimatedBuffer );
+
+- // The Cromagram has the center of C at bin 0, while the major
+- // and minor profiles have the center of C at 1. We want to have
+- // the correlation for C result also at 1.
+- // To achieve this we have to shift two times:
+- MathUtilities::circShift( m_ChrPointer, m_BPO, 2);
++
++ // Move bins such that the centre of the base note is in the
++ // middle of its three bins :
++ // Added 21.11.07 by Chris Sutton based on debugging with Katy
++ // Noland + comparison with Matlab equivalent.
++ MathUtilities::circShift( m_ChrPointer, m_BPO, 1);
+ /*
+ std::cout << "raw chroma: ";
+ for (int ii = 0; ii < m_BPO; ++ii) {
+@@ -265,10 +266,8 @@ int GetKeyMode::process(double *PCMData)
+ std::cout << std::endl;
+ */
+ double dummy;
+- // m_Keys[1] is C center 1 / 3 + 1 = 1
+- // m_Keys[4] is D center 4 / 3 + 1 = 2
+- // '+ 1' because we number keys 1-24, not 0-23.
+- key = MathUtilities::getMax( m_Keys, 2* m_BPO, &dummy ) / 3 + 1;
++ // '1 +' because we number keys 1-24, not 0-23.
++ key = 1 + (int)ceil( (double)MathUtilities::getMax( m_Keys, 2* m_BPO, &dummy )/3 );
+
+ // std::cout << "key pre-sorting: " << key << std::endl;