From 668cc77a479efd5eb1a98695de1ea04ba2ffa811 Mon Sep 17 00:00:00 2001 From: Paul Giblock Date: Sun, 21 Sep 2008 18:50:03 +0000 Subject: [PATCH] Add pitchbend to Mallets instrument git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1671 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 4 ++++ plugins/stk/mallets/mallets.cpp | 2 ++ plugins/stk/mallets/mallets.h | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7e5fa243a..b81a48e97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -66,6 +66,10 @@ - Move smoothing button to a more noticable location - Some coding style changes + * plugins/stk/mallets/mallets.cpp: + * plugins/stk/mallets/mallets.h: + Add support for pitch bend + 2008-09-20 Paul Giblock * plugins/sf2_player/sf2_player.cpp: diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index 694c5cd27..b155355c6 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -267,6 +267,8 @@ void malletsInstrument::playNote( notePlayHandle * _n, bool, const fpp_t frames = _n->framesLeftForCurrentPeriod(); malletsSynth * ps = static_cast( _n->m_pluginData ); + ps->setFrequency( freq ); + sample_t add_scale = 0.0f; if( p == 10 ) { diff --git a/plugins/stk/mallets/mallets.h b/plugins/stk/mallets/mallets.h index b15134736..5e46ec3e9 100644 --- a/plugins/stk/mallets/mallets.h +++ b/plugins/stk/mallets/mallets.h @@ -105,6 +105,14 @@ public: return( s ); } + inline void setFrequency( const StkFloat _pitch ) + { + if( m_voice ) + { + m_voice->setFrequency( _pitch ); + } + } + protected: Instrmnt * m_voice;