Hi Benjamin,
Now I need to figure out automatically adding cautionary accidentals
the first time the pitch appears after the accidental has been reset.
I've been having trouble finding documentation on defining new
accidental Styles, but I will continue looking a bit before turning to
the forum for more help.
I didn't search the archives for a ready-made solution, but I just want
to point you to the (reasonably well-documented) place where the
standard accidentalStyles are defined: They are all in
scm/music-functions.scm.
In particular, you could look at the definition of the modern style and
tweak its "laziness", since in the definition of make-accidental-rule,
we read:
@var{laziness} states over how many bars an accidental should be remembered.
@code{0}@tie{}is the default -- accidental lasts over 0@tie{}bar lines, that
is, to the end of current measure. A positive integer means that the
accidental lasts over that many bar lines. @w{@code{-1}} is `forget
immediately', that is, only look at key signature. @code{#t} is `forever'."
Maybe this is not compatible with your wish to enforce repetition of
accidentals after a (invisible) bar line. But since everything is
written in Scheme, one should be able to hook into
check-pitch-against-signature if push comes to shove.
Best
Lukas