Skip to content

Commit

Permalink
Revert "do not clamp out-of-bounds ControlPotmeter parameters when al…
Browse files Browse the repository at this point in the history
…lowed"

This reverts commit 9ee2d1c, which
made it so controllers not mapped using the new relative mode Pot
in Components lost control of the tempo fader when sync made it
go out of bounds, as reported here:
#1237 (comment)
  • Loading branch information
Be-ing committed Jun 29, 2017
1 parent 06353fa commit 0fc7bf9
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/control/controlbehavior.cpp
Expand Up @@ -56,12 +56,10 @@ double ControlPotmeterBehavior::valueToParameter(double dValue) {
if (m_dValueRange == 0.0) {
return 0;
}
if (!m_bAllowOutOfBounds) {
if (dValue > m_dMaxValue) {
dValue = m_dMaxValue;
} else if (dValue < m_dMinValue) {
dValue = m_dMinValue;
}
if (dValue > m_dMaxValue) {
dValue = m_dMaxValue;
} else if (dValue < m_dMinValue) {
dValue = m_dMinValue;
}
return (dValue - m_dMinValue) / m_dValueRange;
}
Expand Down Expand Up @@ -118,12 +116,10 @@ double ControlLogPotmeterBehavior::valueToParameter(double dValue) {
if (m_dValueRange == 0.0) {
return 0;
}
if (!m_bAllowOutOfBounds) {
if (dValue > m_dMaxValue) {
dValue = m_dMaxValue;
} else if (dValue < m_dMinValue) {
dValue = m_dMinValue;
}
if (dValue > m_dMaxValue) {
dValue = m_dMaxValue;
} else if (dValue < m_dMinValue) {
dValue = m_dMinValue;
}
double linPrameter = (dValue - m_dMinValue) / m_dValueRange;
double dbParamter = ratio2db(linPrameter + m_minOffset * (1 - linPrameter));
Expand Down

0 comments on commit 0fc7bf9

Please sign in to comment.