fix(processor): close S-VIEW-4 previewVelocity persistence loop
Add previewVelocity_ member to ReaSamplerProcessor; populate it in getState and restore it in setState so the field round-trips in the plugin, not just in the pure unit test. Clamp 1..127 at the deserialize read boundary in sample_map.cpp.
This commit is contained in:
@@ -628,7 +628,11 @@ ComponentState deserializeComponentState(const std::vector<std::uint8_t>& bytes,
|
||||
if (!r.ok) return out; // truncated before/inside the marker -> empty (marker 0 holds)
|
||||
const std::uint8_t previewVel = r.u8();
|
||||
if (!r.ok) return out; // truncated before the velocity byte -> empty (mid default holds)
|
||||
out.previewVelocity = previewVel;
|
||||
// Clamp to the documented MIDI 1..127 range: a 0 byte (or any out-of-spec value from a
|
||||
// corrupt blob) falls back to the mid default rather than silencing the preview trigger.
|
||||
out.previewVelocity = (previewVel >= 1 && previewVel <= 127)
|
||||
? previewVel
|
||||
: kPreviewVelocityDefault;
|
||||
const std::uint32_t idLen = r.u32();
|
||||
out.selectionId = r.str(idLen);
|
||||
if (!r.ok) { out.selectionId.clear(); return out; } // truncated id -> empty
|
||||
|
||||
Reference in New Issue
Block a user