Thank you, all, for these helpful replies! Kieren, your method works (and best of all, with it, \accidentalStyle choral-cautionary works as desired). Hans, your code also works well. I will keep both these approaches in mind.
I lean slightly toward Hans’s approach over Kieren’s, as it feels closer to the experience of composing by hand in pencil/pen on manuscript paper: “I’ve written out all the notes that go in this measure, so now I’ll draw a bar line signaling its end,” without having to count the number of “quarter note equivalents” and go back to the beginning of the measure and write a \time command. But, again, it’s good to have multiple options available to me for my engraving projects. Thank you! On Tue, 2 Dec 2025 at 18:09, Hans Aikema wrote: > On 2 Dec 2025, at 17:39, Gabriel Ellsworth 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. > > [image: AccidentalResetInCadenzas.png] > > > %%% 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 > } > } > > %%% SNIPPET END > > >
