From 14d7740533048deb104fcf0c4dd6b93aac6f1c35 Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Sun, 13 Aug 2006 14:08:28 +0000 Subject: [PATCH] - added minQ "constant" - limit Q resonance git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@321 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/basic_filters.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/basic_filters.h b/include/basic_filters.h index 8eee65eb1..29a20cc8c 100644 --- a/include/basic_filters.h +++ b/include/basic_filters.h @@ -61,6 +61,11 @@ public: DOUBLE_MOOG = 16+MOOG } ; + static inline float minQ( void ) + { + return( 0.01f ); + } + static inline filterTypes getFilterType( const int _idx ) { if( _idx < SIMPLE_FLT_CNT ) @@ -220,13 +225,14 @@ public: inline void calcFilterCoeffs( const filterTypes _type, float _freq, - const float _q + float _q /*, const bool _q_is_bandwidth = FALSE*/ ) { // temp coef vars m_type = _type; - _freq = tMax( _freq, 0.01f );// limit freq for not getting + _freq = tMax( _freq, 0.01f );// limit freq and q for not getting // bad noise out of the filter... + _q = tMax( _q, minQ() ); switch( m_type ) {