Increase VA envelopes to 16 or 32 segments? #46
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
bcox/tymbal#46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This could give us a montage-style motion sequence.
Done in
9a1c914—SegmentEnvelope::kMaxSegmentsis 32.Step curves were already here (
Segment::jump, minor 38), so this was length only. Modal and waveguide take the longer envelopes too, since the constant is shared and their destination maps don't scale with it.This is a breaking format change. The VA map numbers a time lane and a level lane per segment per envelope, so
kDestinationCountwent 169 → 409 — past what a one-byte destination index can address.ModEntry::destinationand the wire format both widen to 16 bits, and a matrix entry is 12 bytes now (source, via, two-byte destination, mode, a reserved zero, amount). That, plus the fixed envelope block growing 184 → 664 bytes, are changes an older reader must refuse rather than skip — so the format is major 3. The minor deliberately continues to 42: everyminor >= Ngate in the readers still admits exactly the records its own history entry describes, and restarting the count would flip all of them false.Two live bugs fell out of the widening and are fixed here:
static_cast<std::uint8_t>, so every VA layer the editor creates would have shipped with its vactrol routes aimed at LFO lanes;Cost, measured rather than derived:
sizeof(VaLayerType)6576 → 8592 (1920 of it the matrix's two Sample arrays over 240 further destinations, 32 the touched_ bitmap, 64 touched_list_ at two bytes an entry);sizeof(Layer)8992 → 9008;sizeof(VoiceType)663704 → 663896. The VA alternative is still not the variant's largest, so the pool grows only by the wider index reaching every engine's matrix.Default,
--config=opt,--config=asanand--config=ubsanall 102/102;--config=tsan //plugin:preset_race_testpasses.render_golden_testdid not move, which is the evidence that nothing about the renderer changed.Decisions taken while building that the plan did not anticipate — the reserved byte, the non-resetting minor, why
kHandleLimitstill is not carried into the VA envelope view — are indocs/superpowers/ledgers/2026-09-10-va-32-segments.md.