From e2d86fc3a64c365da542b3d569b49ed82f13f810 Mon Sep 17 00:00:00 2001 From: Lou Herard Date: Mon, 12 Nov 2007 07:14:47 +0000 Subject: [PATCH] git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@585 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/effect_lib.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/include/effect_lib.h b/include/effect_lib.h index a042a4728..63c75230b 100644 --- a/include/effect_lib.h +++ b/include/effect_lib.h @@ -444,18 +444,42 @@ namespace effectLib m_wideCoeff( _wide_coeff ) { } + + // Lou's Hack + void setWideCoeff( const float _wideCoeff ) + { + m_wideCoeff = _wideCoeff; + } + + int getWideCoeff() + { + return m_wideCoeff; + } + // ----------- virtual void nextSample( SAMPLE & _in_left, SAMPLE & _in_right ) const { + /* const float delta = ( _in_left - ( _in_left+_in_right ) / 2.0f ) * m_wideCoeff; _in_left += delta; _in_right -= delta; + */ + + + // Lou's Hack + // I really can't tell you why this math works, but it sounds good + float toRad = 3.141592 / 180; + _in_left += _in_right * sinf( m_wideCoeff * .5 * toRad); + _in_right -= _in_left * sinf( m_wideCoeff * .5 * toRad); + } private: - const float m_wideCoeff; + // Lou's Hack + int m_wideCoeff; + //----------- } ; } ;