summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mdaPianoVoice.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mdaPianoVoice.cpp b/src/mdaPianoVoice.cpp
index 322b534..b48c0a8 100644
--- a/src/mdaPianoVoice.cpp
+++ b/src/mdaPianoVoice.cpp
@@ -139,6 +139,11 @@ void mdaPianoVoice::release(unsigned char velocity)
void mdaPianoVoice::render(uint32_t from, uint32_t to)
{
+ // abort if no key is pressed
+ // initially m_key is INVALID_KEY, so no sound will be rendered
+ if (m_key == LV2::INVALID_KEY)
+ return;
+
float x, l, r;
uint32_t i;