Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/presets/Monstro/Growl.xpf
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
<attribute name="plugin" value="Clip"/>
</key>
</effect>
<effect name="dualfilter" autoquit_denominator="4" on="1" autoquit_numerator="4" wet="1" autoquit_syncmode="0" gate="0.02" autoquit="1">
<effect name="dualfilter" autoquit_denominator="4" on="1" autoquit_numerator="4" wet="1" autoquit_syncmode="0" autoquit="1">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I do this for rest of the presets?

<DualFilterControls mix="-0.14" filter1="1" filter2="1" res1="0.5" res2="0.5" cut1="197" enabled1="1" gain1="100" cut2="229" enabled2="1" gain2="100"/>
<key/>
</effect>
<effect name="ladspaeffect" autoquit_denominator="4" on="1" autoquit_numerator="4" wet="1" autoquit_syncmode="0" gate="1" autoquit="1">
<effect name="ladspaeffect" autoquit_denominator="4" on="1" autoquit_numerator="4" wet="1" autoquit_syncmode="0" autoquit="1">
<ladspacontrols ports="6" link="1">
<port00 data="-4.875" link="1"/>
<port01 data="1" link="1"/>
Expand Down
16 changes: 0 additions & 16 deletions include/Effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,6 @@ class LMMS_EXPORT Effect : public Plugin
return 1.0f - m_wetDryModel.value();
}

inline float gate() const
{
const float level = m_gateModel.value();
return level*level * m_processors;
}

inline f_cnt_t bufferCount() const
{
return m_bufferCount;
Expand Down Expand Up @@ -174,15 +168,6 @@ class LMMS_EXPORT Effect : public Plugin


protected:
/**
Effects should call this at the end of audio processing

If the setting "Keep effects running even without input" is disabled,
after "decay" ms of a signal below "gate", the effect is turned off
and won't be processed again until it receives new audio input
*/
void checkGate( double _out_sum );

gui::PluginView* instantiateView( QWidget * ) override;

// some effects might not be capable of higher sample-rates so they can
Expand Down Expand Up @@ -227,7 +212,6 @@ class LMMS_EXPORT Effect : public Plugin

BoolModel m_enabledModel;
FloatModel m_wetDryModel;
FloatModel m_gateModel;
TempoSyncKnobModel m_autoQuitModel;

bool m_autoQuitDisabled;
Expand Down
1 change: 0 additions & 1 deletion include/EffectView.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ public slots:
LedCheckBox * m_bypass;
Knob * m_wetDry;
TempoSyncKnob * m_autoQuit;
Knob * m_gate;
QMdiSubWindow * m_subWindow;
EffectControlDialog * m_controlView;

Expand Down
2 changes: 0 additions & 2 deletions plugins/Amplifier/Amplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ bool AmplifierEffect::processAudioBuffer(SampleFrame* buf, const fpp_t frames)
outSum += currentFrame.sumOfSquaredAmplitudes();
}

checkGate(outSum / frames);

return isRunning();
}

Expand Down
2 changes: 0 additions & 2 deletions plugins/BassBooster/BassBooster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ bool BassBoosterEffect::processAudioBuffer( SampleFrame* buf, const fpp_t frames
outSum += currentFrame.sumOfSquaredAmplitudes();
}

checkGate( outSum / frames );

return isRunning();
}

Expand Down
2 changes: 0 additions & 2 deletions plugins/Bitcrush/Bitcrush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ bool BitcrushEffect::processAudioBuffer( SampleFrame* buf, const fpp_t frames )
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
}

checkGate( outSum / frames );

return isRunning();
}

Expand Down
1 change: 0 additions & 1 deletion plugins/Compressor/Compressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ bool CompressorEffect::processAudioBuffer(SampleFrame* buf, const fpp_t frames)
rOutPeak = s[1] > rOutPeak ? s[1] : rOutPeak;
}

checkGate(outSum / frames);
m_compressorControls.m_outPeakL = lOutPeak;
m_compressorControls.m_outPeakR = rOutPeak;
m_compressorControls.m_inPeakL = lInPeak;
Expand Down
2 changes: 0 additions & 2 deletions plugins/CrossoverEQ/CrossoverEQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ bool CrossoverEQEffect::processAudioBuffer( SampleFrame* buf, const fpp_t frames
outSum += buf[f][0] * buf[f][0] + buf[f][1] * buf[f][1];
}

checkGate( outSum / frames );

return isRunning();
}

Expand Down
1 change: 0 additions & 1 deletion plugins/Delay/DelayEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ bool DelayEffect::processAudioBuffer( SampleFrame* buf, const fpp_t frames )
lfoTimePtr += lfoTimeInc;
feedbackPtr += feedbackInc;
}
checkGate( outSum / frames );
m_delayControls.m_outPeakL = peak.left();
m_delayControls.m_outPeakR = peak.right();

Expand Down
1 change: 0 additions & 1 deletion plugins/Dispersion/Dispersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ bool DispersionEffect::processAudioBuffer(SampleFrame* buf, const fpp_t frames)
outSum += buf[f][0] * buf[f][0] + buf[f][1] * buf[f][1];
}

checkGate(outSum / frames);
return isRunning();
}

Expand Down
2 changes: 0 additions & 2 deletions plugins/DualFilter/DualFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ bool DualFilterEffect::processAudioBuffer( SampleFrame* buf, const fpp_t frames
mixPtr += mixInc;
}

checkGate( outSum / frames );

return isRunning();
}

Expand Down
2 changes: 0 additions & 2 deletions plugins/DynamicsProcessor/DynamicsProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ bool DynProcEffect::processAudioBuffer( SampleFrame* _buf,
out_sum += _buf[f][0] * _buf[f][0] + _buf[f][1] * _buf[f][1];
}

checkGate( out_sum / _frames );

return( isRunning() );
}

Expand Down
2 changes: 0 additions & 2 deletions plugins/Eq/EqEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ bool EqEffect::processAudioBuffer( SampleFrame* buf, const fpp_t frames )
m_eqControls.m_outPeakL = m_eqControls.m_outPeakL < outPeak[0] ? outPeak[0] : m_eqControls.m_outPeakL;
m_eqControls.m_outPeakR = m_eqControls.m_outPeakR < outPeak[1] ? outPeak[1] : m_eqControls.m_outPeakR;

checkGate( outSum / frames );

if(m_eqControls.m_analyseOutModel.value( true ) && outSum > 0 && m_eqControls.isViewVisible() )
{
m_eqControls.m_outFftBands.analyze( buf, frames );
Expand Down
1 change: 0 additions & 1 deletion plugins/Flanger/FlangerEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ bool FlangerEffect::processAudioBuffer( SampleFrame* buf, const fpp_t frames )
buf[f][1] = ( d * dryS[1] ) + ( w * buf[f][1] );
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
}
checkGate( outSum / frames );
return isRunning();
}

Expand Down
1 change: 0 additions & 1 deletion plugins/LOMM/LOMM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ bool LOMMEffect::processAudioBuffer(SampleFrame* buf, const fpp_t frames)
outSum += buf[f][0] + buf[f][1];
}

checkGate(outSum / frames);
return isRunning();
}

Expand Down
2 changes: 0 additions & 2 deletions plugins/LadspaEffect/LadspaEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ bool LadspaEffect::processAudioBuffer( SampleFrame* _buf,
sampleBack( _buf, o_buf, m_maxSampleRate );
}

checkGate( out_sum / frames );


bool is_running = isRunning();
m_pluginMutex.unlock();
Expand Down
1 change: 0 additions & 1 deletion plugins/Lv2Effect/Lv2Effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ bool Lv2Effect::processAudioBuffer(SampleFrame* buf, const fpp_t frames)
auto r = static_cast<double>(buf[f][1]);
outSum += l*l + r*r;
}
checkGate(outSum / frames);

return isRunning();
}
Expand Down
2 changes: 0 additions & 2 deletions plugins/MultitapEcho/MultitapEcho.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ bool MultitapEchoEffect::processAudioBuffer( SampleFrame* buf, const fpp_t frame
buf[f][1] = d * buf[f][1] + w * m_work[f][1];
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
}

checkGate( outSum / frames );

return isRunning();
}
Expand Down
3 changes: 0 additions & 3 deletions plugins/ReverbSC/ReverbSC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ bool ReverbSCEffect::processAudioBuffer( SampleFrame* buf, const fpp_t frames )
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
}


checkGate( outSum / frames );

return isRunning();
}

Expand Down
1 change: 0 additions & 1 deletion plugins/StereoEnhancer/StereoEnhancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ bool StereoEnhancerEffect::processAudioBuffer( SampleFrame* _buf,
m_currFrame %= DEFAULT_BUFFER_SIZE;
}

checkGate( out_sum / _frames );
if( !isRunning() )
{
clearMyBuffer();
Expand Down
2 changes: 0 additions & 2 deletions plugins/StereoMatrix/StereoMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ bool StereoMatrixEffect::processAudioBuffer( SampleFrame* _buf,

}

checkGate( out_sum / _frames );

return( isRunning() );
}

Expand Down
1 change: 0 additions & 1 deletion plugins/VstEffect/VstEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ bool VstEffect::processAudioBuffer( SampleFrame* _buf, const fpp_t _frames )
delete[] buf;
#endif

checkGate( out_sum / _frames );
}
return isRunning();
}
Expand Down
2 changes: 0 additions & 2 deletions plugins/WaveShaper/WaveShaper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ bool WaveShaperEffect::processAudioBuffer( SampleFrame* _buf,
inputPtr += inputInc;
}

checkGate( out_sum / _frames );

return( isRunning() );
}

Expand Down
32 changes: 0 additions & 32 deletions src/core/Effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Effect::Effect( const Plugin::Descriptor * _desc,
m_bufferCount( 0 ),
m_enabledModel( true, this, tr( "Effect enabled" ) ),
m_wetDryModel( 1.0f, -1.0f, 1.0f, 0.01f, this, tr( "Wet/Dry mix" ) ),
m_gateModel( 0.0f, 0.0f, 1.0f, 0.01f, this, tr( "Gate" ) ),
m_autoQuitModel( 1.0f, 1.0f, 8000.0f, 100.0f, 1.0f, this, tr( "Decay" ) ),
m_autoQuitDisabled( false )
{
Expand Down Expand Up @@ -91,7 +90,6 @@ void Effect::saveSettings( QDomDocument & _doc, QDomElement & _this )
m_enabledModel.saveSettings( _doc, _this, "on" );
m_wetDryModel.saveSettings( _doc, _this, "wet" );
m_autoQuitModel.saveSettings( _doc, _this, "autoquit" );
m_gateModel.saveSettings( _doc, _this, "gate" );
controls()->saveState( _doc, _this );
}

Expand All @@ -103,7 +101,6 @@ void Effect::loadSettings( const QDomElement & _this )
m_enabledModel.loadSettings( _this, "on" );
m_wetDryModel.loadSettings( _this, "wet" );
m_autoQuitModel.loadSettings( _this, "autoquit" );
m_gateModel.loadSettings( _this, "gate" );

QDomNode node = _this.firstChild();
while( !node.isNull() )
Expand Down Expand Up @@ -144,35 +141,6 @@ Effect * Effect::instantiate( const QString& pluginName,
}




void Effect::checkGate( double _out_sum )
{
if( m_autoQuitDisabled )
{
return;
}

// Check whether we need to continue processing input. Restart the
// counter if the threshold has been exceeded.
if (_out_sum - gate() <= F_EPSILON)
{
incrementBufferCount();
if( bufferCount() > timeout() )
{
stopRunning();
resetBufferCount();
}
}
else
{
resetBufferCount();
}
}




gui::PluginView * Effect::instantiateView( QWidget * _parent )
{
return new gui::EffectView( this, _parent );
Expand Down
8 changes: 0 additions & 8 deletions src/gui/EffectView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
m_autoQuit->setHintText( tr( "Time:" ), "ms" );


m_gate = new Knob( KnobType::Bright26, this );
m_gate->setLabel( tr( "GATE" ) );
m_gate->move( 116 - m_gate->width() / 2, 5 );
m_gate->setEnabled( isEnabled && !effect()->m_autoQuitDisabled );
m_gate->setHintText( tr( "Gate:" ), "" );


setModel( _model );

if( effect()->controls()->controlCount() > 0 )
Expand Down Expand Up @@ -278,7 +271,6 @@ void EffectView::modelChanged()
m_bypass->setModel( &effect()->m_enabledModel );
m_wetDry->setModel( &effect()->m_wetDryModel );
m_autoQuit->setModel( &effect()->m_autoQuitModel );
m_gate->setModel( &effect()->m_gateModel );
}

} // namespace lmms::gui