2 ==============================================================================
3 This file is part of Tal-Reverb by Patrick Kunz.
5 Copyright(c) 2005-2009 Patrick Kunz, TAL
9 This file may be licensed under the terms of of the
10 GNU General Public License Version 2 (the ``GPL'').
12 Software distributed under the License is distributed
13 on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14 express or implied. See the GPL for the specific language
15 governing rights and limitations.
17 You should have received a copy of the GPL along with this
18 program. If not, go to http://www.gnu.org/licenses/gpl.html
19 or write to the Free Software Foundation, Inc.,
20 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 ==============================================================================
25 #if !defined(__ParamChangeUtil_h)
26 #define __ParamChangeUtil_h
30 // Low pass filter for gentle parameter changes
36 float paramWeigthInverse
;
39 // param weight should be bigger than 1
40 ParamChangeUtil(float sampleRate
, float paramWeight
)
43 this->paramWeight
= paramWeight
* sampleRate
/ 44100.0f
;
44 paramWeigthInverse
= 1.0f
/ (this->paramWeight
+ 1.0f
);
47 inline float tick(float input
)
49 currentValue
= (paramWeight
* currentValue
+ input
) * paramWeigthInverse
;