see
https://lilypond.org/doc/v2.24/Documentation/notation/displaying-pitches#automatic-accidentals
way at the end is your answer: \accidentalStyle forget
Jeff
On 12/2/2025 9:39 AM, 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
%%% 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
--
o_ Jeff Olson
(\___\/_____/) jjocanoe
~ ~ ~ / ~ ~ ~ ~ @gmail.com