diff src/LiveInstruments.cpp @ 302:cac0be04c43c livemode

Add output for the templates (probably temporarily)
author Chris Cannam
date Tue, 02 Dec 2014 17:13:10 +0000
parents 00fab71b80ec
children d8468176339d
line wrap: on
line diff
--- a/src/LiveInstruments.cpp	Mon Dec 01 17:12:19 2014 +0000
+++ b/src/LiveInstruments.cpp	Tue Dec 02 17:13:10 2014 +0000
@@ -55,8 +55,10 @@
 	    }
             
 	    // re-normalise
-	    for (int k = 0; k < (int)t.data[j].size(); ++k) {
-                t.data[j][k] *= 1.f / sum;
+            if (sum > 0.f) {
+                for (int k = 0; k < (int)t.data[j].size(); ++k) {
+                    t.data[j][k] *= 1.f / sum;
+                }
             }
 	}