diff songparts/plugins/SongParts.cpp @ 7:6d32e730e34b

In this version crash problems has been solved
author maxzanoni76 <max.zanoni@eecs.qmul.ac.uk>
date Thu, 12 Apr 2012 00:29:45 +0100
parents f5d9a52542fb
children ccfdf972c04b
line wrap: on
line diff
--- a/songparts/plugins/SongParts.cpp	Wed Apr 11 16:34:47 2012 +0100
+++ b/songparts/plugins/SongParts.cpp	Thu Apr 12 00:29:45 2012 +0100
@@ -1243,23 +1243,22 @@
     arma::uvec nullindices = arma::ones<arma::uvec>(barline.size());
     for (unsigned iPart=0; iPart<parts.size(); ++iPart)
     {
-        for (unsigned iIndex=0; iIndex<parts[0].indices.size(); ++iIndex) 
-        {
+        //for (unsigned iIndex=0; iIndex < parts[0].indices.size(); ++iIndex) 
+        for (unsigned iIndex=0; iIndex < parts[iPart].indices.size(); ++iIndex) 
             for (unsigned i=0; i<parts[iPart].n; ++i) 
             {
                 unsigned ind = parts[iPart].indices[iIndex]+i;
                 nullindices(ind) = 0;
             }
-        }
     }
-    
+
     Part newPart;
     newPart.n = 1;
     uvec q = find(nullindices > 0);
     
     for (unsigned i=0; i<q.size();++i) 
         newPart.indices.push_back(q(i));
-        
+
     newPart.letter = '-';
     newPart.value = 0;
     newPart.level = 0;
@@ -1568,8 +1567,6 @@
             uword maIdx;
             ma = t1.max(maIdx);
             
-            std::cout << maIdx << " - " << ma << std::endl;
-            
             if ((maIdx == 0)&&(ma == 0))
                 break;
 
@@ -1642,6 +1639,7 @@
    
     arma::vec bar = linspace(1,nBeat,nBeat);    
     Part np = nullpart(parts,bar);
+    
     parts.push_back(np);
     
     // -------------- NOT CONVERTED -------------------------------------  
@@ -1782,8 +1780,8 @@
     vector<Part> finalParts;
     
     parts = songSegment(quatisedChromagram);
-        
     songSegmentChroma(quatisedChromagram,parts);
+    
     finalParts = songSegmentIntegration(parts);