Is there a specific reason you want to use \cadenzaOn? I think it's easier
to do something similar to what's in the existing Lilypond documentation
<https://lilypond.org/doc/v2.24/Documentation/notation/chants-psalms-and-hymns#setting-a-chant>.
That is, use a meter and hide the time signatures. If you have irregular
measures, you can set up a parallel voice:
spine = {
\time 5/2 s1 s2 s1 |
\time 3/1 s1*3 | \bar "||"
\time 5/2 s1 s2 s1 |
\time 3/1 s1*3 | \fine
}
notes = \relative c'' {
\key g \major
g1 aes4 ees4 g1 |
ees1 f4 ees4 d4 aes'4 g1 |
fis1 e4 fis4 g1 |
a1 f4 ees4 d4 fis4 g1 |
}
\score {
\new Staff << \spine \notes >>
\layout {
\context {
\Score
\omit TimeSignature
}
}
}
On Tue, 2 Dec 2025 at 08:41, Gabriel Ellsworth <[email protected]>
wrote:
> I am working on a psalm set to written-out Anglican chant, for which I use
> \cadenzaOn.
>
> I understand from reading previous threads that \bar commands simply add
> the visual appearance of a bar line. On the back end, as I gather, LilyPond
> does not treat a \bar event as a measure demarcation for the purposes of
> accidentals.
>
> This is causing problems in my score, as noted in the below MWE. Ideally,
> I’d like to use the choral-cautionary accidental style, but with LilyPond
> treating every barline as the end of a measure.
>
> For now, I have to use a bunch of exclamation marks and question marks to
> control accidental appearances manually. Is there a better way?
>
> My best idea right now is to “temporarily re-enable timing and use
> \partial to create a tiny measure” (see the documentation
> <https://lilypond.org/doc/v2.24/Documentation/notation/displaying-rhythms#unmetered-music>).
> But I’d prefer a solution that doesn’t require me to clutter up my code
> every time I come across some accidentals. Another option: In this message
> <https://lists.gnu.org/archive/html/lilypond-user/2013-03/msg01162.html>,
> Harm suggested \once \accidentalStyle forget. That works, except that I’d
> have to remember to do it in all places like the downbeat of “measure” 2. And
> it doesn’t include the smart parentheses of the -cautionary styles.
>
> Gabriel
>
> %%% SNIPPET BEGINS
>
> \version "2.24.4"
>
> \relative c'' {
> \key g \major
> g1 aes4 ees4 g1 \bar "|"
>
> % \once \accidentalStyle forget
> ees1 % needs an accidental
> f4 ees4 d4
> aes'4 % needs an accidental
> g1 \bar "||"
>
> fis1 e4 % both of these notes should have cautionary (parenthetical)
> accidentals
> fis4 g1 \bar "|"
>
> a1 % should have cautionary (parenthetical) accidental
> f4 ees4 d4 fis4 g1 \fine
> }
>
> \layout {
> \context {
> \Score
> \omit TimeSignature
> \cadenzaOn % unmetered music (disables automatic measure demarcation)
> }
> \context {
> \Staff
> \hide Stem
> \accidentalStyle choral-cautionary % has no effect on the output
> % \accidentalStyle forget % if enabled, LilyPond prints some desired
> accidentals
> % but also prints some extraneous/undesired accidentals
> % and also fails to print a sharp sign on the first F-sharp
> }
> }
>
> %%% SNIPPET ENDS
>