Close pass four: undetented host curve read, LiveValues guard, ordering assert, static-lane fix, docs

Points toPlain's exponent arm at the undetented curve map so host reads
match the editor; adds a sizeof guard plus field-poison test for
LiveValues::operator==; skips the model write when an automation value
hasn't moved; corrects five stale doc citations.
This commit is contained in:
2026-08-02 18:22:21 -04:00
parent 1fd38bbd57
commit 9b5393098b
14 changed files with 163 additions and 59 deletions
+7 -3
View File
@@ -179,11 +179,12 @@ InstrumentParams ReaSamplerProcessor::instrumentParams(std::uint32_t& generation
return params_;
}
void ReaSamplerProcessor::setInstrumentParams(const InstrumentParams& params) {
std::uint32_t ReaSamplerProcessor::setInstrumentParams(const InstrumentParams& params) {
// The exposed values alone, not the whole set: this funnel fires per mouse move on every live
// knob and node drag, and InstrumentParams owns seven vectors — copying all of them to diff
// 44 doubles is the cost, and the diff is what the notification actually needs.
double before[kDeckParamSlots];
std::uint32_t generation;
{
std::lock_guard<std::mutex> lock(paramsMutex_);
for (const instrument::param::ParamRow& row : instrument::param::exposedParams()) {
@@ -191,8 +192,10 @@ void ReaSamplerProcessor::setInstrumentParams(const InstrumentParams& params) {
}
params_ = params;
// Bumped inside the lock with the write it names, so a reader taking the pair together
// can never see a generation that does not describe the set beside it.
++paramsGeneration_;
// can never see a generation that does not describe the set beside it. Read back before
// the unlock for the same reason — a caller wanting ITS OWN write's generation must not
// race a second writer's bump between this function's unlock and its return.
generation = ++paramsGeneration_;
}
// Every writer of the parameter set — setState, the editor's commits, the bake's adopt —
// funnels through here, so mirroring the limiter flag at this one point is what keeps the
@@ -214,6 +217,7 @@ void ReaSamplerProcessor::setInstrumentParams(const InstrumentParams& params) {
// limiter mirror sits here: an internal write that skipped it would leave the host
// displaying — and, on the next touch, re-imposing — the superseded value.
notifyParamsFromModel(before, params);
return generation;
}
void ReaSamplerProcessor::flushLatencyRestart() {