From 3be2e89d370d3c111f7404e853872b77f5aff18c Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 23 Feb 2014 14:40:15 +0100 Subject: [PATCH] DspEffectLibrary: renamed from effectLib --- include/DspEffectLibrary.h | 352 ++++++++++++++ include/SweepOscillator.h | 23 +- include/effect_lib.h | 452 ------------------ plugins/BassBooster/BassBooster.cpp | 2 +- plugins/BassBooster/BassBooster.h | 4 +- .../dynamics_processor/dynamics_processor.h | 1 - plugins/kicker/kicker.cpp | 6 +- plugins/lb302/lb302.cpp | 2 +- plugins/lb302/lb302.h | 4 +- plugins/stereo_enhancer/stereo_enhancer.cpp | 8 +- plugins/stereo_enhancer/stereo_enhancer.h | 10 +- plugins/waveshaper/waveshaper.h | 1 - 12 files changed, 380 insertions(+), 485 deletions(-) create mode 100644 include/DspEffectLibrary.h delete mode 100644 include/effect_lib.h diff --git a/include/DspEffectLibrary.h b/include/DspEffectLibrary.h new file mode 100644 index 000000000..5231184a1 --- /dev/null +++ b/include/DspEffectLibrary.h @@ -0,0 +1,352 @@ +/* + * DspEffectLibrary.h - library with template-based inline-effects + * + * Copyright (c) 2006-2014 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifndef _DSP_EFFECT_LIBRARY_H +#define _DSP_EFFECT_LIBRARY_H + +#include + +#include "templates.h" +#include "lmms_constants.h" +#include "lmms_basics.h" + + +namespace DspEffectLibrary +{ + + template + class MonoBase + { + public: + typedef class MonoBypass bypassType; + + static void process( sample_t * * _buf, const f_cnt_t _frames ) + { + for( f_cnt_t f = 0; f < _frames; ++f ) + { + _buf[f][0] = T::nextSample( _buf[f][0] ); + } + } + } ; + + template + class StereoBase + { + public: + typedef class StereoBypass bypassType; + + static void process( sample_t * * _buf, const f_cnt_t _frames ) + { + for( f_cnt_t f = 0; f < _frames; ++f ) + { + T::nextSample( _buf[f][0], _buf[f][1] ); + } + } + } ; + + + template + class MonoToStereoAdaptor : public StereoBase > + { + public: + MonoToStereoAdaptor( const FXL& monoFX ) : + m_leftFX( monoFX ), + m_rightFX( monoFX ) + { + } + + MonoToStereoAdaptor( const FXL& leftFX, const FXR& rightFX ) : + m_leftFX( leftFX ), + m_rightFX( rightFX ) + { + } + + void nextSample( sample_t& inLeft, sample_t& inRight ) + { + inLeft = m_leftFX.nextSample( inLeft ); + inRight = m_rightFX.nextSample( inRight ); + } + + FXL& leftFX() + { + return( m_leftFX ); + } + + FXR& rightFX() + { + return( m_rightFX ); + } + + private: + FXL m_leftFX; + FXR m_rightFX; + } ; + + + template + class StereoToMonoAdaptor : public MonoBase > + { + public: + StereoToMonoAdaptor( const FX& fx ) : + m_FX( fx ) + { + } + + sample_t nextSample( sample_t in ) + { + sample_t s[2] = { in, in }; + m_FX.nextSample( s[0], s[1] ); + + return ( s[0] + s[1] ) / 2.0f; + } + + private: + FX m_FX; + + } ; + + class MonoBypass : public MonoBase + { + public: + sample_t nextSample( sample_t in ) + { + return in; + } + } ; + + + class StereoBypass : public StereoBase + { + public: + void nextSample( sample_t&, sample_t& ) + { + } + } ; + + /* convenient class to build up static FX chains, for example + + using namespace DspEffectLib; + chain >, + chain, + MonoToStereoAdaptor > > > + fxchain( bassBoost<>( 60.0, 1.0, 4.0f ), + chain, + MonoToStereoAdaptor > >( + StereoEnhancer<>( 1.0 ), + FoldbackDistortion<>( 1.0f, 1.0f ) ) ); + + // now you can do simple calls such as which will process a bass-boost-, + // stereo enhancer- and foldback distortion effect on your buffer + fx_chain.process( (sample_t * *) buf, frames ); +*/ + + template + class Chain : public FX0::bypassType + { + public: + typedef typename FX0::sample_t sample_t; + Chain( const FX0& fx0, const FX1& fx1 = FX1() ) : + m_FX0( fx0 ), + m_FX1( fx1 ) + { + } + + void process( sample_t** buf, const f_cnt_t frames ) + { + m_FX0.process( buf, frames ); + m_FX1.process( buf, frames ); + } + + private: + FX0 m_FX0; + FX1 m_FX1; + + } ; + + + + template + inline sample_t saturate( sample_t x ) + { + return qMin( qMax( -1.0f, x ), 1.0f ); + } + + + class FastBassBoost : public MonoBase + { + public: + FastBassBoost( const sample_t _frequency, + const sample_t _gain, + const sample_t _ratio, + const FastBassBoost & _orig = FastBassBoost() ) : + m_frequency( qMax( _frequency, 10.0 ) ), + m_gain1( 1.0 / ( m_frequency + 1.0 ) ), + m_gain2( _gain ), + m_ratio( _ratio ), + m_cap( _orig.m_cap ) + { + } + + inline sample_t nextSample( sample_t _in ) + { + // TODO: somehow remove these horrible aliases... + m_cap = ( _in + m_cap*m_frequency ) * m_gain1; + return( /*saturate(*/ ( _in + m_cap*m_ratio ) * + m_gain2/* )*/ ); + } + + void setFrequency( const sample_t _frequency ) + { + m_frequency = _frequency; + m_gain1 = 1.0 / ( m_frequency + 1.0 ); + } + + void setGain( const sample_t _gain ) + { + m_gain2 = _gain; + } + + void setRatio( const sample_t _ratio ) + { + m_ratio = _ratio; + } + + private: + FastBassBoost() : + m_cap( 0.0 ) + { + } + + sample_t m_frequency; + sample_t m_gain1; + sample_t m_gain2; + sample_t m_ratio; + sample_t m_cap; + } ; + + + class FoldbackDistortion : public MonoBase + { + public: + FoldbackDistortion( float threshold, float gain ) : + m_threshold( threshold ), + m_gain( gain ) + { + } + + sample_t nextSample( sample_t in ) + { + if( in >= m_threshold || in < -m_threshold ) + { + return ( fabsf( fabsf( fmodf( in - m_threshold, m_threshold*4 ) ) - m_threshold*2 ) - m_threshold ) * m_gain; + } + return in * m_gain; + } + + void setThreshold( float threshold ) + { + m_threshold = threshold; + } + + void setGain( float gain ) + { + m_gain = gain; + } + + + private: + float m_threshold; + float m_gain; + + } ; + + + class Distortion : public MonoBase + { + public: + Distortion( float threshold, float gain ) : + m_threshold( threshold ), + m_gain( gain ) + { + } + + sample_t nextSample( sample_t in ) + { + return m_gain * ( in * ( fabsf( in )+m_threshold ) / ( in*in +( m_threshold-1 )* fabsf( in ) + 1 ) ); + } + + void setThreshold( float threshold ) + { + m_threshold = threshold; + } + + void setGain( float gain ) + { + m_gain = gain; + } + + + private: + float m_threshold; + float m_gain; + + } ; + + + class StereoEnhancer : public StereoBase + { + public: + StereoEnhancer( float wideCoeff ) : + m_wideCoeff( wideCoeff ) + { + } + + void setWideCoeff( float wideCoeff ) + { + m_wideCoeff = wideCoeff; + } + + float wideCoeff() + { + return m_wideCoeff; + } + + void nextSample( sample_t& inLeft, sample_t& inRight ) + { + const float toRad = 3.141592 / 180; + + inLeft += inRight * sinf( m_wideCoeff * .5 * toRad); + inRight -= inLeft * sinf( m_wideCoeff * .5 * toRad); + } + + private: + float m_wideCoeff; + + } ; + +} ; + + +#endif diff --git a/include/SweepOscillator.h b/include/SweepOscillator.h index 38403488e..aa2729eef 100644 --- a/include/SweepOscillator.h +++ b/include/SweepOscillator.h @@ -1,7 +1,7 @@ /* * SweepOscillator.h - sweeping oscillator * - * Copyright (c) 2006-2009 Tobias Doerffel + * Copyright (c) 2006-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,10 +26,10 @@ #define _SWEEP_OSCILLATOR_H #include "Oscillator.h" -#include "effect_lib.h" +#include "DspEffectLibrary.h" -template +template class SweepOscillator { public: @@ -43,19 +43,16 @@ public: { } - void update( sampleFrame * _ab, const fpp_t _frames, - const float _freq1, const float _freq2, - const float _sample_rate ) + void update( sampleFrame* buf, const fpp_t frames, const float freq1, const float freq2, const float sampleRate ) { - const float df = _freq2 - _freq1; - for( fpp_t frame = 0; frame < _frames; ++frame ) + const float df = freq2 - freq1; + for( fpp_t frame = 0; frame < frames; ++frame ) { const sample_t s = Oscillator::sinSample( m_phase ); - _ab[frame][0] = s; - _ab[frame][1] = s; - m_FX.nextSample( _ab[frame][0], _ab[frame][1] ); - m_phase += ( _freq1 + ( frame * df / _frames ) ) / - _sample_rate; + buf[frame][0] = s; + buf[frame][1] = s; + m_FX.nextSample( buf[frame][0], buf[frame][1] ); + m_phase += ( freq1 + ( frame * df / frames ) ) / sampleRate; } } diff --git a/include/effect_lib.h b/include/effect_lib.h deleted file mode 100644 index 06b8414fc..000000000 --- a/include/effect_lib.h +++ /dev/null @@ -1,452 +0,0 @@ -/* - * effect_lib.h - library with template-based inline-effects - * - * Copyright (c) 2006-2008 Tobias Doerffel - * - * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program (see COPYING); if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - */ - - -#ifndef _EFFECT_LIB_H -#define _EFFECT_LIB_H - -#include - -#include "templates.h" -#include "lmms_constants.h" -#include "lmms_basics.h" - - -namespace effectLib -{ - - template - class monoBase - { - public: - typedef class monoBypass bypassType; - - static void process( sample_t * * _buf, const f_cnt_t _frames ) - { - for( f_cnt_t f = 0; f < _frames; ++f ) - { - _buf[f][0] = T::nextSample( _buf[f][0] ); - } - } - } ; - - template - class stereoBase - { - public: - typedef class stereoBypass bypassType; - - static void process( sample_t * * _buf, const f_cnt_t _frames ) - { - for( f_cnt_t f = 0; f < _frames; ++f ) - { - T::nextSample( _buf[f][0], _buf[f][1] ); - } - } - } ; - - - template - class monoToStereoAdaptor : public stereoBase > - { - public: - monoToStereoAdaptor( const FXL & _mono_fx ) : - m_leftFX( _mono_fx ), - m_rightFX( _mono_fx ) - { - } - - monoToStereoAdaptor( const FXL & _left_fx, - const FXR & _right_fx ) : - m_leftFX( _left_fx ), - m_rightFX( _right_fx ) - { - } - - void nextSample( sample_t & _in_left, sample_t & _in_right ) - { - _in_left = m_leftFX.nextSample( _in_left ); - _in_right = m_rightFX.nextSample( _in_right ); - } - - FXL & leftFX() - { - return( m_leftFX ); - } - - FXR & rightFX() - { - return( m_rightFX ); - } - - private: - FXL m_leftFX; - FXR m_rightFX; - } ; - - - template - class stereoToMonoAdaptor : public monoBase > - { - public: - stereoToMonoAdaptor( const FX & _stereo_fx ) : - m_FX( _stereo_fx ) - { - } - - sample_t nextSample( sample_t _in ) - { - sample_t s[2] = { _in, _in }; - m_FX.nextSample( s[0], s[1] ); - return( ( s[0] + s[1] ) / 2.0f ); - } - - private: - FX m_FX; - } ; - - - class monoBypass : public monoBase - { - public: - monoBypass() - { - } - - sample_t nextSample( sample_t _in ) - { - return( _in ); - } - } ; - - - class stereoBypass : public stereoBase - { - public: - void nextSample( sample_t &, sample_t & ) - { - } - } ; - - - /* convenient class to build up static FX-chains, for example - - using namespace effectLib; - chain >, - chain, - monoToStereoAdaptor > > > - fxchain( bassBoost<>( 60.0, 1.0, 4.0f ), - chain, - monoToStereoAdaptor > >( - stereoEnhancer<>( 1.0 ), - foldbackDistortion<>( 1.0f, 1.0f ) ) ); - - // now you can do simple calls such as which will process a bass-boost-, - // stereo-enhancer- and foldback-distortion-effect on your buffer - fx_chain.process( (sample_t * *) buf, frames ); -*/ - - template - class chain : public FX0::bypassType - { - public: - typedef typename FX0::sample_t sample_t; - chain( const FX0 & _fx0, const FX1 & _fx1 = FX1() ) : - m_FX0( _fx0 ), - m_FX1( _fx1 ) - { - } - - void process( sample_t * * _buf, const f_cnt_t _frames ) - { - m_FX0.process( _buf, _frames ); - m_FX1.process( _buf, _frames ); - } - - private: - FX0 m_FX0; - FX1 m_FX1; - } ; - - - - template - inline sample_t saturate( sample_t _x ) - { - return( qMin( qMax( -1.0f, _x ), 1.0f ) ); - } - - - class fastBassBoost : public monoBase - { - public: - fastBassBoost( const sample_t _frequency, - const sample_t _gain, - const sample_t _ratio, - const fastBassBoost & _orig = - fastBassBoost() ) : - m_frequency( qMax( _frequency, 10.0 ) ), - m_gain1( 1.0 / ( m_frequency + 1.0 ) ), - m_gain2( _gain ), - m_ratio( _ratio ), - m_cap( _orig.m_cap ) - { - } - - inline sample_t nextSample( sample_t _in ) - { - // TODO: somehow remove these horrible aliases... - m_cap = ( _in + m_cap*m_frequency ) * m_gain1; - return( /*saturate(*/ ( _in + m_cap*m_ratio ) * - m_gain2/* )*/ ); - } - - void setFrequency( const sample_t _frequency ) - { - m_frequency = _frequency; - m_gain1 = 1.0 / ( m_frequency + 1.0 ); - } - - void setGain( const sample_t _gain ) - { - m_gain2 = _gain; - } - - void setRatio( const sample_t _ratio ) - { - m_ratio = _ratio; - } - - private: - fastBassBoost() : - m_cap( 0.0 ) - { - } - - sample_t m_frequency; - sample_t m_gain1; - sample_t m_gain2; - sample_t m_ratio; - sample_t m_cap; - } ; - - // for some reason this effect doesn't work... (in=out) - class bassBoost : public monoBase - { - public: - bassBoost( const float _frequency, - const float _gain, - const float _ratio, - const float _sample_rate ) : - m_gain( _gain ), - m_beta( -1.0f ), - m_shape( 1.0f ), - m_sampleRate( _sample_rate ) - { - xn1=xn2=yn1=yn2=0.0f; - setFrequency( _frequency ); - setRatio( _ratio ); - } - - sample_t nextSample( sample_t _in ) - { - const float out = ( m_b0*_in + m_b1*xn1 + m_b2*xn2 - - m_a1*yn1 - m_a2*yn2 ) / m_a0; - xn2 = xn1; - xn1 = _in; - yn2 = yn1; - yn1 = out; - return out*m_gain; - } - - void setFrequency( const float _frequency ) - { - const float omega = 2*F_PI*_frequency/m_sampleRate; - m_sin = sinf( omega ); - m_cos = cosf( omega ); - if( m_beta > 0 ) - { - updateFilter(); - } - } - - void setGain( const float _gain ) - { - m_gain = _gain; - } - - void setRatio( const float _ratio ) - { - m_a = expf( logf( 1.0f ) * _ratio / 40 ); - updateFilter(); - } - - private: - void updateFilter() - { - m_beta = sqrtf( ( m_a*m_a + 1 ) / m_shape - - powf( m_a - 1, 2 ) ); - m_b0 = m_a*((m_a+1)-(m_a-1)*m_cos + m_beta*m_sin); - m_b1 = 2*m_a*((m_a-1) - (m_a+1) * m_cos); - m_b2 = m_a*((m_a+1) - (m_a-1)*m_cos - m_beta*m_sin); - m_a0 = ((m_a+1) + (m_a-1)*m_cos + m_beta*m_sin); - m_a1 = -2*((m_a-1) + (m_a+1) * m_cos); - m_a2 = (m_a+1) + (m_a-1)*m_cos-m_beta*m_sin; - } - float m_gain; - float m_a; - float m_sin; - float m_cos; - float m_beta; - const float m_shape; - const float m_sampleRate; - float m_b0, m_b1, m_b2, m_a0, m_a1, m_a2; - float xn1, xn2, yn1, yn2; - } ; - - - class foldbackDistortion : public monoBase - { - public: - foldbackDistortion( const float _threshold, - const float _gain ) : - m_threshold( _threshold ), - m_gain( _gain ) - { - } - - sample_t nextSample( sample_t _in ) - { - if( _in >= m_threshold || _in < -m_threshold ) - { - return ( fabsf( fabsf( - fmodf( _in - m_threshold, - m_threshold*4 ) ) - - m_threshold*2 ) - - m_threshold ) * - m_gain; - } - return _in * m_gain; - } - - void setThreshold( const float _threshold ) - { - m_threshold = _threshold; - } - - void setGain( const float _gain ) - { - m_gain = _gain; - } - - - private: - float m_threshold; - float m_gain; - - } ; - - - class distortion : public monoBase - { - public: - distortion( float _threshold, float _gain ) : - m_threshold( _threshold ), - m_gain( _gain ) - { - } - - sample_t nextSample( sample_t _in ) - { - return( m_gain * ( _in * ( fabsf( _in )+m_threshold ) / - ( _in*_in +( m_threshold-1 )* - fabsf( _in ) + 1 ) ) ); - } - - void setThreshold( const float _threshold ) - { - m_threshold = _threshold; - } - - void setGain( const float _gain ) - { - m_gain = _gain; - } - - - private: - float m_threshold; - float m_gain; - - } ; - - - class stereoEnhancer : public stereoBase - { - public: - stereoEnhancer( float _wide_coeff ) : - m_wideCoeff( _wide_coeff ) - { - } - - // Lou's Hack - void setWideCoeff( float _wideCoeff ) - { - m_wideCoeff = _wideCoeff; - } - - float getWideCoeff() - { - return m_wideCoeff; - } - // ----------- - - void nextSample( sample_t & _in_left, sample_t & _in_right ) - { - /* - 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: - // Lou's Hack - float m_wideCoeff; - //----------- - } ; - -} ; - - -#endif diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index cdee354a5..9e205087d 100644 --- a/plugins/BassBooster/BassBooster.cpp +++ b/plugins/BassBooster/BassBooster.cpp @@ -49,7 +49,7 @@ Plugin::Descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor = BassBoosterEffect::BassBoosterEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ) : Effect( &bassbooster_plugin_descriptor, parent, key ), - m_bbFX( effectLib::fastBassBoost( 70.0f, 1.0f, 2.8f ) ), + m_bbFX( DspEffectLibrary::FastBassBoost( 70.0f, 1.0f, 2.8f ) ), m_bbControls( this ) { } diff --git a/plugins/BassBooster/BassBooster.h b/plugins/BassBooster/BassBooster.h index 778959b73..9a2b5fa33 100644 --- a/plugins/BassBooster/BassBooster.h +++ b/plugins/BassBooster/BassBooster.h @@ -27,7 +27,7 @@ #define _BASS_BOOSTER_H #include "Effect.h" -#include "effect_lib.h" +#include "DspEffectLibrary.h" #include "BassBoosterControls.h" @@ -45,7 +45,7 @@ public: private: - effectLib::monoToStereoAdaptor m_bbFX; + DspEffectLibrary::MonoToStereoAdaptor m_bbFX; BassBoosterControls m_bbControls; diff --git a/plugins/dynamics_processor/dynamics_processor.h b/plugins/dynamics_processor/dynamics_processor.h index 287b46d55..364a2a3d1 100644 --- a/plugins/dynamics_processor/dynamics_processor.h +++ b/plugins/dynamics_processor/dynamics_processor.h @@ -28,7 +28,6 @@ #define _DYNPROC_H #include "Effect.h" -#include "effect_lib.h" #include "dynamics_processor_controls.h" diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index ae52d8c81..e721530d1 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -108,9 +108,9 @@ QString kickerInstrument::nodeName() const -//typedef effectLib::foldbackDistortion<> DistFX; -typedef effectLib::distortion DistFX; -typedef SweepOscillator > SweepOsc; +//typedef DspEffectLibrary::foldbackDistortion<> DistFX; +typedef DspEffectLibrary::Distortion DistFX; +typedef SweepOscillator > SweepOsc; void kickerInstrument::playNote( NotePlayHandle * _n, diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index d4127b712..ab9a0e926 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -143,7 +143,7 @@ lb302FilterIIR2::lb302FilterIIR2(lb302FilterKnobState* p_fs) : vcf_c(1) { - m_dist = new effectLib::distortion( 1.0, 1.0f); + m_dist = new DspEffectLibrary::Distortion( 1.0, 1.0f); }; diff --git a/plugins/lb302/lb302.h b/plugins/lb302/lb302.h index 9ce92cfb7..84f0ef8a7 100644 --- a/plugins/lb302/lb302.h +++ b/plugins/lb302/lb302.h @@ -32,7 +32,7 @@ #ifndef _LB302_H_ #define _LB302_H_ -#include "effect_lib.h" +#include "DspEffectLibrary.h" #include "Instrument.h" #include "InstrumentView.h" #include "led_checkbox.h" @@ -96,7 +96,7 @@ class lb302FilterIIR2 : public lb302Filter vcf_b, // vcf_c; - effectLib::distortion * m_dist; + DspEffectLibrary::Distortion * m_dist; }; diff --git a/plugins/stereo_enhancer/stereo_enhancer.cpp b/plugins/stereo_enhancer/stereo_enhancer.cpp index b9c75b3fe..442d49ccd 100644 --- a/plugins/stereo_enhancer/stereo_enhancer.cpp +++ b/plugins/stereo_enhancer/stereo_enhancer.cpp @@ -1,8 +1,8 @@ /* * stereo_enhancer.cpp - stereo-enhancer-effect-plugin * - * Copyright (c) 2006-2009 Tobias Doerffel - * + * Copyright (c) 2006-2014 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -53,7 +53,7 @@ stereoEnhancerEffect::stereoEnhancerEffect( Model * _parent, const Descriptor::SubPluginFeatures::Key * _key ) : Effect( &stereoenhancer_plugin_descriptor, _parent, _key ), - m_seFX( effectLib::stereoEnhancer( 0.0f ) ), + m_seFX( DspEffectLibrary::StereoEnhancer( 0.0f ) ), m_delayBuffer( new sampleFrame[DEFAULT_BUFFER_SIZE] ), m_currFrame( 0 ), m_bbControls( this ) @@ -107,7 +107,7 @@ bool stereoEnhancerEffect::processAudioBuffer( sampleFrame * _buf, m_delayBuffer[m_currFrame][1] = _buf[f][1]; // Get the width knob value from the Stereo Enhancer effect - width = m_seFX.getWideCoeff(); + width = m_seFX.wideCoeff(); // Calculate the correct sample frame for processing frameIndex = m_currFrame - width; diff --git a/plugins/stereo_enhancer/stereo_enhancer.h b/plugins/stereo_enhancer/stereo_enhancer.h index 5b52b4122..59e23ad52 100644 --- a/plugins/stereo_enhancer/stereo_enhancer.h +++ b/plugins/stereo_enhancer/stereo_enhancer.h @@ -1,8 +1,8 @@ /* * stereo_enhancer.h - stereo-enhancer-effect-plugin * - * Copyright (c) 2006-2008 Tobias Doerffel - * + * Copyright (c) 2006-2014 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -27,14 +27,14 @@ #define _STEREO_ENHANCER_H #include "Effect.h" -#include "effect_lib.h" +#include "DspEffectLibrary.h" #include "engine.h" #include "stereoenhancer_controls.h" class stereoEnhancerEffect : public Effect { public: - stereoEnhancerEffect( Model * parent, + stereoEnhancerEffect( Model * parent, const Descriptor::SubPluginFeatures::Key * _key ); virtual ~stereoEnhancerEffect(); virtual bool processAudioBuffer( sampleFrame * _buf, @@ -49,7 +49,7 @@ public: private: - effectLib::stereoEnhancer m_seFX; + DspEffectLibrary::StereoEnhancer m_seFX; sampleFrame * m_delayBuffer; int m_currFrame; diff --git a/plugins/waveshaper/waveshaper.h b/plugins/waveshaper/waveshaper.h index 3fc3a536c..84dde1f5c 100644 --- a/plugins/waveshaper/waveshaper.h +++ b/plugins/waveshaper/waveshaper.h @@ -28,7 +28,6 @@ #define _WAVESHAPER_H #include "Effect.h" -#include "effect_lib.h" #include "waveshaper_controls.h"