diff --git a/src/core/EnvelopeAndLfoParameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp index 77acc30d5..76f657411 100644 --- a/src/core/EnvelopeAndLfoParameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -402,7 +402,7 @@ void EnvelopeAndLfoParameters::updateSampleVars() expKnobVal( m_decayModel.value() * m_sustainModel.value() ) ); - m_sustainLevel = 1.0f - m_sustainModel.value(); + m_sustainLevel = m_sustainModel.value(); m_amount = m_amountModel.value(); if( m_amount >= 0 ) { diff --git a/src/gui/widgets/EnvelopeAndLfoView.cpp b/src/gui/widgets/EnvelopeAndLfoView.cpp index c1d06092a..cda8f9e49 100644 --- a/src/gui/widgets/EnvelopeAndLfoView.cpp +++ b/src/gui/widgets/EnvelopeAndLfoView.cpp @@ -441,7 +441,7 @@ void EnvelopeAndLfoView::paintEvent( QPaintEvent * ) p.drawLine( x1, y_base - avail_height, x2, y_base - avail_height ); p.fillRect( x1 - 1, y_base - 2 - avail_height, 4, 4, end_points_bg_color ); - p.fillRect( x1, y_base-1-avail_height, 2, 2, end_points_color ); + p.fillRect( x1, y_base - 1 - avail_height, 2, 2, end_points_color ); x1 = x2; x2 = x1 + static_cast( ( m_decayKnob->value() * m_sustainKnob->value() ) * @@ -449,7 +449,7 @@ void EnvelopeAndLfoView::paintEvent( QPaintEvent * ) p.drawLine( x1, y_base-avail_height, x2, static_cast( y_base - avail_height + - m_sustainKnob->value() * avail_height ) ); + ( 1 - m_sustainKnob->value() ) * avail_height ) ); p.fillRect( x1 - 1, y_base - 2 - avail_height, 4, 4, end_points_bg_color ); p.fillRect( x1, y_base - 1 - avail_height, 2, 2, end_points_color ); @@ -457,14 +457,14 @@ void EnvelopeAndLfoView::paintEvent( QPaintEvent * ) x2 = x1 + static_cast( m_releaseKnob->value() * TIME_UNIT_WIDTH ); p.drawLine( x1, static_cast( y_base - avail_height + - m_sustainKnob->value() * + ( 1 - m_sustainKnob->value() ) * avail_height ), x2, y_base ); - p.fillRect( x1-1, static_cast( y_base - avail_height + - m_sustainKnob->value() * + p.fillRect( x1 - 1, static_cast( y_base - avail_height + + ( 1 - m_sustainKnob->value() ) * avail_height ) - 2, 4, 4, end_points_bg_color ); p.fillRect( x1, static_cast( y_base - avail_height + - m_sustainKnob->value() * + ( 1 - m_sustainKnob->value() ) * avail_height ) - 1, 2, 2, end_points_color ); p.fillRect( x2 - 1, y_base - 2, 4, 4, end_points_bg_color );