diff chromamethods.cpp @ 77:ba930176df5b matthiasm-plugin

fixed. warning: I added some arrays with variable length (though not at runtime).
author Matthias Mauch <mail@matthiasmauch.net>
date Thu, 11 Nov 2010 10:27:58 +0900
parents d398e73b46e0
children 026a5c0ee2c2
line wrap: on
line diff
--- a/chromamethods.cpp	Wed Nov 10 22:52:46 2010 +0900
+++ b/chromamethods.cpp	Thu Nov 11 10:27:58 2010 +0900
@@ -50,7 +50,7 @@
     int lenConvolvee = convolvee.size();
     int lenKernel = kernel.size();
 
-    vector<float> Z(256,0);
+    vector<float> Z(nNote,0);
     assert(lenKernel % 2 != 0); // no exception handling !!!
     
     for (n = lenKernel - 1; n < lenConvolvee; n++) {
@@ -206,7 +206,7 @@
             // cerr << "curramp" << curr_amp << endl;
             for (unsigned iNote = 0; iNote < nNote; ++iNote) {
                 if (abs(iNote+1.0-floatbin)<2) {
-                    dm[iNote  + 256 * iOut] += cospuls(iNote+1.0, floatbin, binspersemitone + 0.0) * curr_amp;
+                    dm[iNote  + nNote * iOut] += cospuls(iNote+1.0, floatbin, binspersemitone + 0.0) * curr_amp;
                     // dm[iNote + nNote * iOut] += 1 * curr_amp;
                 }
             }