set m_key to INVALID_KEY when silent
authorrekado <rekado@elephly.net>
Wed, 16 Jan 2013 12:16:32 +0000 (20:16 +0800)
committerrekado <rekado@elephly.net>
Wed, 16 Jan 2013 12:16:32 +0000 (20:16 +0800)
src/mdaPianoVoice.cpp

index 00198fd..9f75839 100644 (file)
@@ -200,6 +200,11 @@ r = 0.0f;
     p(p_left)[frame] += l + x;
     p(p_right)[frame] += r - x;
   }
+
+  // turn off further processing when the envelope has rendered the voice silent
+  if (env < SILENCE) {
+    m_key = LV2::INVALID_KEY;
+  }
 }