Looks like the function version works.
Interestingly, swapping `\after \duration $A \volta 2 \fine` with
`\volta 2 \after
\duration $A \fine` causes the unfolded music to be missing the AA part.
I’ve noticed a tricky interplay between `\after` and `\volta *x*`
previously.
—Joel
\version "2.24.0"
If I understand correctly, a volta repeat within a D.C. repeat is only
supposed to play the first time. I’ve worked out how to accomplish this in
the presence of `\unfoldRepeats` (as useful for MIDI creation) in the
context of a “thirty-two-bar form”, or AABA-form, song. Might be useful to
others