-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialize peak controller last sample with base value #4382
Conversation
After the change, Peak Controllers will set any connected knobs to their Base value when an LMMS project is loaded, rather than their lowest possible value.
This change makes it so that when an LMMS project is loaded, each knob connected to a Peak Controller will be set to the Peak Controller's Base value, rather than its minimum possible value.
@@ -64,7 +64,7 @@ PeakControllerEffect::PeakControllerEffect( | |||
Effect( &peakcontrollereffect_plugin_descriptor, _parent, _key ), | |||
m_effectId( rand() ), | |||
m_peakControls( this ), | |||
m_lastSample( 0 ), | |||
m_lastSample( m_peakControls.m_baseModel.value() ), //sets the value to the Peak Controller's Base value (rather than 0 like in previous versions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the comment because the variables names' are descriptive enough.
@douglasdgi Thanks for the bugfix! I'm going to go ahead and cherry-pick this onto master as well. |
* Bug fix in peak_controller_effect.cpp This change makes it so that when an LMMS project is loaded, each knob connected to a Peak Controller will be set to the Peak Controller's Base value, rather than its minimum possible value.
This doesn't work because the state of the controls has not been restored at the point where A working approach would be either to set void PeakControllerEffectControls::loadSettings( const QDomElement & _this )
{
m_baseModel.loadSettings( _this, "base" );
m_effect->m_lastSample = m_baseModel.value();
... or to override void PeakControllerEffect::loadSettings( const QDomElement & _this )
{
Effect::loadSettings( _this );
m_lastSample = m_peakControls.m_baseModel.value();
} |
@DomClark I believe newly created peak controllers still need the old change. |
I agree, although it seems less important: changes to a new peak controller's controls don't have an effect on its output until some audio goes through it, so while it would give it a correct initial value, as soon as the user changes the base value it would be incorrect again. |
* Bug fix in peak_controller_effect.cpp This change makes it so that when an LMMS project is loaded, each knob connected to a Peak Controller will be set to the Peak Controller's Base value, rather than its minimum possible value.
* Bug fix in peak_controller_effect.cpp This change makes it so that when an LMMS project is loaded, each knob connected to a Peak Controller will be set to the Peak Controller's Base value, rather than its minimum possible value.
This change makes it so that when an LMMS project is loaded, each knob connected to a Peak Controller will be set to the Peak Controller's Base value, rather than its minimum possible value.