editor: ApplyMaterial does not snap generated tables to the format grid #60
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
bcox/tymbal#60
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?
patches/build.h'sSetModeTablecallsmaterials::Generateand thenplayground::SnapModeTableToFormatGrid, in that order, because a generatedtable carries per-mode ratio and decay values that are arbitrary doubles and
the format stores them as Q32.32.
editor/patch_view.h'sApplyMaterialis the second door onto the samematerials::Generatecall -- the editor's Generate button -- and it does notsnap.
grep -A 12 ApplyMaterial editor/patch_view.h | grep -c SnapModeTableToFormatGridis 0.This is documented as a known follow-up in
plugin/patch_format.h's owncomment on
SnapModeTableToFormatGrid, which says the editor path "has theidentical latent gap -- a table built there and never routed through this
function is exposed to the same rounding hazard on its own save/load".
Latent rather than live:
WritePatchsnaps on the way out, so a table built inthe editor and saved is fine. The exposure is a table built there and compared
or rendered before a save/load round trip, which is the shape that produced a
bit-exact divergence at sample 66 in
patches/hihat.h(see that patch'sheader, and the minor-25 entry in
plugin/patch_format.h).It matters a little more since minor 30, because the cymbals design leans on
ApplyMaterialas the faithful-regeneration path when it argues about whatan old reader loses -- and it is faithful only to about 1e-9 per ratio.
One call, beside the
materials::GenerateinApplyMaterial.Found by the whole-branch review of
modal-cymbals.