diff --git a/ChangeLog b/ChangeLog index 8cba09c44..5bd3a9411 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2006-12-21 Tobias Doerffel + + * include/note_play_handle.h: + * src/core/note_play_handle.cpp: + added parameter to nphsOfInstrumentTrack() which will cause the method + to add note-play-handles even if they're released + + * include/effect_lib.h: + made bassBoost using double-values internally + + * plugins/kicker/kicker.cpp: + * include/effect_lib.h: + introduced new distortion-class which sounds better than + foldback-distortion + 2006-12-20 Javier Serrano Polo * src/widgets/rack_plugin.cpp: diff --git a/configure.in b/configure.in index cec09fe78..a46526a04 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.2.1-svn20061220, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20061220) +AC_INIT(lmms, 0.2.1-svn20061221, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20061221) AM_CONFIG_HEADER(config.h) diff --git a/include/effect_lib.h b/include/effect_lib.h index 56d0bdce2..1e0c4bdec 100644 --- a/include/effect_lib.h +++ b/include/effect_lib.h @@ -220,13 +220,13 @@ namespace effectLib class bassBoost : public monoBase { public: - bassBoost( const float _selectivity, - const float _gain, - const float _ratio, + bassBoost( const double _selectivity, + const double _gain, + const double _ratio, const bassBoost & _orig = bassBoost() ) : - m_selectivity( tMax( _selectivity, 10.0f ) ), - m_gain1( 1.0f / ( m_selectivity + 1.0f ) ), + m_selectivity( tMax( _selectivity, 10.0 ) ), + m_gain1( 1.0 / ( m_selectivity + 1.0 ) ), m_gain2( _gain ), m_ratio( _ratio ), m_cap( _orig.m_cap ) @@ -244,33 +244,33 @@ namespace effectLib m_gain2/* )*/ ); } - void setSelectivity( const float _selectivity ) + void setSelectivity( const double _selectivity ) { m_selectivity = _selectivity; - m_gain1 = 1.0f / ( m_selectivity + 1.0f ); + m_gain1 = 1.0 / ( m_selectivity + 1.0 ); } - void setGain( const float _gain ) + void setGain( const double _gain ) { m_gain2 = _gain; } - void setRatio( const float _ratio ) + void setRatio( const double _ratio ) { m_ratio = _ratio; } private: bassBoost() : - m_cap( 0.0f ) + m_cap( 0.0 ) { } - float m_selectivity; - float m_gain1; - float m_gain2; - float m_ratio; - mutable float m_cap; + double m_selectivity; + double m_gain1; + double m_gain2; + double m_ratio; + mutable double m_cap; } ; @@ -317,6 +317,41 @@ namespace effectLib } ; + template + class distortion : public monoBase + { + public: + distortion( const float _threshold, const float _gain ) : + m_threshold( _threshold ), + m_gain( _gain ) + { + } + + virtual SAMPLE nextSample( const SAMPLE _in ) const + { + 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; + + } ; + + template class stereoEnhancer : public stereoBase { diff --git a/include/note_play_handle.h b/include/note_play_handle.h index a3492afce..3b69ddb51 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -166,9 +166,10 @@ public: // belonging to this channel int index( void ) const; - // note-play-handles belonging to given channel + // note-play-handles belonging to given channel, if _all_ph = TRUE, + // also released note-play-handles are returned static constNotePlayHandleVector nphsOfInstrumentTrack( - const instrumentTrack * _ct ); + const instrumentTrack * _ct, bool _all_ph = FALSE ); // return whether given note-play-handle is equal to *this bool operator==( const notePlayHandle & _nph ) const; diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index 7f415b4c4..908d50e58 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -96,8 +96,8 @@ kickerInstrument::kickerInstrument( instrumentTrack * _instrument_track ) : m_distKnob = new knob( knobDark_28, this, tr( "Distortion" ), eng(), _instrument_track ); - m_distKnob->setRange( 0.00f, 0.99f, 0.01f ); - m_distKnob->setInitValue( 0.1f ); + m_distKnob->setRange( 0.0f, 100.0f, 0.1f ); + m_distKnob->setInitValue( 0.8f ); m_distKnob->setLabel( tr( "DIST" ) ); m_distKnob->setHintText( tr( "Distortion:" ) + " ", "" ); @@ -168,7 +168,8 @@ QString kickerInstrument::nodeName( void ) const -typedef effectLib::foldbackDistortion<> distFX; +//typedef effectLib::foldbackDistortion<> distFX; +typedef effectLib::distortion<> distFX; typedef sweepOscillator > sweepOsc; @@ -181,7 +182,7 @@ void kickerInstrument::playNote( notePlayHandle * _n, bool ) if ( tfp == 0 ) { _n->m_pluginData = new sweepOsc( - distFX( 1.0f-m_distKnob->value(), + distFX( m_distKnob->value(), m_gainKnob->value() ) ); } else if( tfp > decfr && !_n->released() ) diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index 5c55293b2..a1768cbfe 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -383,7 +383,7 @@ int notePlayHandle::index( void ) const constNotePlayHandleVector notePlayHandle::nphsOfInstrumentTrack( - const instrumentTrack * _it ) + const instrumentTrack * _it, bool _all_ph ) { const playHandleVector & phv = _it->eng()->getMixer()->playHandles(); constNotePlayHandleVector cnphv; @@ -394,7 +394,7 @@ constNotePlayHandleVector notePlayHandle::nphsOfInstrumentTrack( const notePlayHandle * nph = dynamic_cast( *it ); if( nph != NULL && nph->m_instrumentTrack == _it && - nph->released() == FALSE ) + ( nph->released() == FALSE || _all_ph == TRUE ) ) { cnphv.push_back( nph ); }