From ed7d929b2c9887ba7b7e79d1d9b658c5fba1871e Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Sun, 24 Jul 2016 04:08:39 +0200 Subject: [PATCH] Limit velocity for stk::modal amplitude range --- plugins/stk/mallets/mallets.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index e4ec07c0c..db5d1a205 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -289,7 +289,10 @@ void malletsInstrument::playNote( NotePlayHandle * _n, const float freq = _n->frequency(); if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) { - const float vel = _n->getVolume() / 100.0f; + // If newer projects, adjust velocity to within stk's limits + float velocityAdjust = + m_isOldVersionModel.value() ? 100.0 : 200.0; + const float vel = _n->getVolume() / velocityAdjust; // critical section as STK is not thread-safe static QMutex m;