Dear David, Looking at the regtests to which you have provided the link, I was wondering if the following code using \tag might be worth testing out. It uses \tag, \keepWithTag, and \removeWithTag:
%% B E G I N %%
% Grace note example made by Yoshiaki Onishi (October 2026) - for David Kastrup
\version "2.26.0"
withGrace = {
\tag #'grace { c'1 \time 3/4 \grace {c'16 } e'2.}
\tag #'withoutGrace { c'1 \time 3/4 e'2.}
\tag #'howItShouldLook { c'1 \time 3/4 \grace {s16} e'2.}
}
\score {
\new StaffGroup
<<
\keepWithTag #'grace \withGrace
%%%%% Uncomment one of the following three lines %%%%%
%\keepWithTag #'withoutGrace \withGrace
%\removeWithTag #'(grace howItShouldLook) \withGrace
%\keepWithTag #'howItShouldLook \withGrace
>>
}
%% E N D %%
Very grateful for your work on this!
Yoshi
-- -- --
Yoshiaki Onishi
https://github.com/yoshiakionishi/lilypond-snippets
grace-note-example.ly
Description: Binary data
