diff transform/RealTimePluginTransform.cpp @ 74:47fd14e29813

* Fix long-standing off-by-1 bug in WaveFileModel that was getting us the wrong values for almost all audio data when merging channels (channel == -1) * Implement cut, copy and paste * Make draw mode work properly in time value layer * Minor fixes to CSV import
author Chris Cannam
date Fri, 07 Apr 2006 17:50:33 +0000
parents 7afcfe666910
children
line wrap: on
line diff
--- a/transform/RealTimePluginTransform.cpp	Thu Apr 06 17:24:13 2006 +0000
+++ b/transform/RealTimePluginTransform.cpp	Fri Apr 07 17:50:33 2006 +0000
@@ -136,6 +136,12 @@
 	    while (got < blockSize) {
 		buffers[0][got++] = 0.0;
 	    }
+            if (m_channel == -1 && channelCount > 1) {
+                // use mean instead of sum, as plugin input
+                for (size_t i = 0; i < got; ++i) {
+                    buffers[0][i] /= channelCount;
+                }
+            }                
 	} else {
 	    for (size_t ch = 0; ch < channelCount; ++ch) {
 		got = input->getValues