Completion Heads with forced/cautionary accidentals

Tina Petzel <[email protected]> Wed, 04 Feb 2026 21:25:15 +0100
Newsgroups gmane.comp.gnu.lilypond.devel,gmane.comp.gnu.lilypond.general,gmane.comp.gnu.lilypond.bugs
Message-ID <2343052.iZASKD2KPV@archbox>
--nextPart22997735.EfDdHjke4D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

Hey all,

I=E2=80=99ve found weird behaviour with the completion heads engraver wrt. =
to forced accidentals:

%%%
\new Voice \with {
  \remove Note_heads_engraver
  \consists Completion_heads_engraver
} { cis''!1*3 }
%%%

What is happening here is that forced/cautionary accidentals work by settin=
g an event/grob=20
property (for which then the accidental engraver checks).

But the Competion heads engraver creates all note heads from copies of the =
same event, which=20
means that indeed the above would be equivalent to

%%%
{ cis''!1~ cis''!1~ cis''!1 }
%%%

This I think is almost never what we=E2=80=99d actually want to see. Since =
I currently use the Completion=20
heads engraver for a project I wrote a patch which simply sets the forced-a=
ccidental/cautionary=20
properties to #f after creating a note head, meaning the properties would b=
e true at most until=20
the first note head.

This is probably not a good fix, but I don=E2=80=99t understand the code we=
ll enough to quickly come up=20
with a better solution for now.

Leaving this here for discussion

1. Surely this is to be seen as a bug?
2. What would be a good fix? Potentially it would make sense to have an Acc=
idental event=20
attached to the note head or something?

*But even then, the problem does not appear for articulations and stuff lik=
e this*

%%%
\new Voice \with {
  \remove Note_heads_engraver
  \consists Completion_heads_engraver
} { <cis''!>1*3-2 }
%%%

only because the script engraver looks for articulatons attached to note ev=
ents (that are not=20
handed during iteration) and then removed from the original event (which is=
 also not really that=20
much of a clean thing). In fact we see the same problem say here:

%%%
\new Voice \with {
  \remove Note_heads_engraver
  \consists Completion_heads_engraver
} { <cis''!-2>1*3 }
%%%

Not sure what=E2=80=99s the best thing to do here ...

Best regards,
Tina

--nextPart22997735.EfDdHjke4D
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEET9lQp3Sisy/pK6sBnDUJWyIflYEFAmmDqysACgkQnDUJWyIf
lYEBhhAAhwa+219Z6gveJEJ+yRzrUj0j0fiYSXH1Zn7Q4HOfikXW1F0DWVNyYd5C
HmS0an7jQrG+/qq8PWipw8VRlASRAkhSiTmM17f633RBxfNh3/WntClxu4y5ES1h
QtCZfRVL4Fe2WnVQ3wCZtsTsW53RHtVFHN3Wv6alvaJ99lmEyGWBYgmnEzcMFG17
+xnFzTugjfCw7cuiw279VVKF9y1Tl0mIT2Zzn4KmhSGLulY2GNy2vOAMc6jdxIYp
QVhl9HCIzGNaZ40ZkYPBE57b++2V/bZFsjzomuq0Jo8JQAP8s7FUdy4HbFs5MyX2
OfMzwEly1fPYqnc542fXs3WfnkTyn6+cJu2jjbMD75TBjhG1gMWd9Eg+MAfCcRAj
ptDAElTvuYEFBQJ5MdI4jPxnx7gS5AgSPdIhcEp4EsYjbwqdgzqV9gSr3OwLjeFV
4OxMJ6+FYT535doBjmHmMCog1fSPeNNXAVfGg4hWSNJr/ePQW0St+aqU3kPTmXvY
vBeh5DetsWkFIIm8gDp/4nUe+ehUOHxADg8HE6SJREKRsxa9z5UOKoKi0KynAp9a
AJ1vkusljJnyFvjnSi7yLCy4R0+dMFv30oVtTMCey9WROiDufkZhlMoYAnuDcdvO
HaDIc+9cEHp1qrlvkIjAqoelMUq1xdLfpyNYdHT+6SBKllKoEDs=
=HYfE
-----END PGP SIGNATURE-----

--nextPart22997735.EfDdHjke4D--