diff audioio/ContinuousSynth.cpp @ 418:8d2112977aa0 tonioni

Don't clear ring buffers & regenerate when adding a model that is muted anyway
author Chris Cannam
date Tue, 11 Nov 2014 16:34:22 +0000
parents d2c13ec0f148
children aa6fb3516e28
line wrap: on
line diff
--- a/audioio/ContinuousSynth.cpp	Mon Nov 10 09:20:33 2014 +0000
+++ b/audioio/ContinuousSynth.cpp	Tue Nov 11 16:34:22 2014 +0000
@@ -48,8 +48,8 @@
     bool nowOn = (f0 > 0.f);
 
     if (!nowOn && !wasOn) {
-    m_phase = 0;
-    return;
+        m_phase = 0;
+        return;
     }
 
     int fadeLength = 100; // samples
@@ -57,11 +57,11 @@
     float *levels = new float[m_channels];
     
     for (int c = 0; c < m_channels; ++c) {
-    levels[c] = gain * 0.5; // scale gain otherwise too loud compared to source
+        levels[c] = gain * 0.5; // scale gain otherwise too loud compared to source
     }
     if (pan != 0.0 && m_channels == 2) {
-    levels[0] *= 1.0 - pan;
-    levels[1] *= pan + 1.0;
+        levels[0] *= 1.0 - pan;
+        levels[1] *= pan + 1.0;
     }
 
 //    cerr << "ContinuousSynth::mix: f0 = " << f0 << " (from " << m_prevF0 << "), phase = " << m_phase << endl;