Bound the automation hold to the window the model has not caught up on, and make that authority model stated, enforced and tested
This commit is contained in:
@@ -36,7 +36,6 @@ using instrument::ui::kDeckKnobSize;
|
||||
using instrument::ui::kPad;
|
||||
using instrument::ui::deckParamNorm;
|
||||
using instrument::ui::kEnvTimeMaxSeconds;
|
||||
using instrument::ui::kKeyTrackMax;
|
||||
using instrument::ui::resetDeckParam;
|
||||
using instrument::ui::sampleDeckGroups;
|
||||
using instrument::ui::setDeckParam;
|
||||
@@ -119,7 +118,7 @@ double ReaSamplerEditor::deckControlNorm(int id) const {
|
||||
if (id == kBakeHoldKnobId) return bakeHoldNorm();
|
||||
switch (static_cast<ParamControl>(id)) {
|
||||
case ParamControl::kKeyTrack:
|
||||
return clamp01(params_.keyTrack / kKeyTrackMax);
|
||||
return instrument::ui::keyTrackNormFrom(params_.keyTrack);
|
||||
case ParamControl::kVoiceCount:
|
||||
return clamp01(static_cast<double>(voiceCount_ - kMinVoiceCount) /
|
||||
static_cast<double>(kMaxVoiceCount - kMinVoiceCount));
|
||||
@@ -272,8 +271,9 @@ EnvClampBounds ReaSamplerEditor::envClampBounds() const {
|
||||
|
||||
void ReaSamplerEditor::applyParamControl(int id, double value, int segment) {
|
||||
if (id == static_cast<int>(ParamControl::kKeyTrack)) {
|
||||
// keyTrack sits beside the play bundle (0..200% over kKeyTrackMax); the knob maps 0..1.
|
||||
params_.keyTrack = clamp01(value) * kKeyTrackMax;
|
||||
// keyTrack sits beside the play bundle, so it takes deck_values' own pair rather than
|
||||
// the PlaySeconds binding.
|
||||
params_.keyTrack = instrument::ui::keyTrackFromNorm(value);
|
||||
} else {
|
||||
applyControl(id, params_.play, value, segment);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user