From 88daa8a6cff065dad9a399928b9f2aa21081a066 Mon Sep 17 00:00:00 2001 From: rekado Date: Wed, 16 Jan 2013 20:16:32 +0800 Subject: set m_key to INVALID_KEY when silent --- src/mdaPianoVoice.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/mdaPianoVoice.cpp b/src/mdaPianoVoice.cpp index 00198fd..9f75839 100644 --- a/src/mdaPianoVoice.cpp +++ b/src/mdaPianoVoice.cpp @@ -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; + } } -- cgit v1.2.3