> On 2 Dec 2025, at 17:39, 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 >
How about the following extended application of the very short partial measure with a silent rest as inspired by the documentation in https://lilypond.org/doc/v2.24/Documentation/notation/displaying-rhythms#Unmetered-music applied to your snippet.  %%% SNIPPET START \version "2.24.4" cadenzaSectionMeasure = { \cadenzaOff \partial 1024 s1024 \bar "||" \cadenzaOn } cadenzaMeasure = { \cadenzaOff \partial 1024 s1024 \cadenzaOn } \relative c'' { \key g \major g1 aes4 ees4 g1 \cadenzaMeasure ees1 % needs an accidental f4 ees4 d4 aes'4 % needs an accidental g1 \cadenzaSectionMeasure fis1 e4 % both of these notes should have cautionary (parenthetical) accidentals fis4 g1 \cadenzaMeasure 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 END
