diff --git a/res/controllers/midi-components-0.0.js b/res/controllers/midi-components-0.0.js index 5286298ca66e..1215948e267d 100644 --- a/res/controllers/midi-components-0.0.js +++ b/res/controllers/midi-components-0.0.js @@ -362,53 +362,18 @@ this.firstValueReceived = false; }; Pot.prototype = new Component({ - relative: false, - shift: function () { - if (this.relative) { - this.input = function (channel, control, value, status, group) { - // Do not manipulate inKey, just store the position of the - // physical potentiometer for calculating how much it moves - // when shift is released. - if (this.MSB !== undefined) { - value = (this.MSB << 7) + value; - } - this.previousValueReceived = value; - } + input: function (channel, control, value, status, group) { + if (this.MSB !== undefined) { + value = (this.MSB << 7) + value; } - }, - unshift: function () { - this.input = function (channel, control, value, status, group) { - if (this.MSB !== undefined) { - value = (this.MSB << 7) + value; - } - if (this.relative) { - if (this.previousValueReceived !== undefined) { - var delta = (value - this.previousValueReceived) / this.max; - if (this.invert) { - delta = -delta; - } - this.inSetParameter(this.inGetParameter() + delta); - } else { - var newValue = value / this.max; - if (this.invert) { - newValue = 1 - newValue; - } - if (this.loadStateOnStartup) { - this.inSetParameter(newValue); - } - } - this.previousValueReceived = value; - } else { - var newValue = this.inValueScale(value); - if (this.invert) { - newValue = 1 - newValue; - } - this.inSetParameter(newValue); - if (!this.firstValueReceived) { - this.firstValueReceived = true; - this.connect(); - } - } + var newValue = this.inValueScale(value); + if (this.invert) { + newValue = 1 - newValue; + } + this.inSetParameter(newValue); + if (!this.firstValueReceived) { + this.firstValueReceived = true; + this.connect(); } }, // Input handlers for 14 bit MIDI diff --git a/src/control/controlbehavior.cpp b/src/control/controlbehavior.cpp index e00fb5216f1e..a435bf7d973f 100644 --- a/src/control/controlbehavior.cpp +++ b/src/control/controlbehavior.cpp @@ -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; } @@ -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));