Thanks.  I did figure it out, and it ended up being a pretty simple change.
accidental-styles.chant-cautionary =
#`(#t
      (Staff ,(make-accidental-rule 'same-octave 0))
      (Staff ,(make-accidental-rule 'same-octave #t)))

Now I am trying to figure out how to draw the first accidental within a
melisma at the beginning of the group of notes rather than immediately
before the note it modifies.  I'd be interested if anyone has any ideas
where to start on that.  I will consult the documentation and see what I
can come up with.

Thanks,

*Benjamin Bloomfield*

On Wed, Apr 15, 2020 at 10:02 AM Lukas-Fabian Moser <l...@gmx.de> wrote:

> 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
>

Reply via email to