Actually, I do have an advanced guess on why it happens. The \grace command sets some properties for the NoteHead object within the current Voice context. Then, LilyPond will make a local copy of the list of properties for the NoteHead object within this specific Voice context. So, the properties you set with \property Staff.NoteHead ... will no more be visible to the current Voice context.
This intricate detail of how property settings work is probably obvious to Han-Wen and Jan who wrote the code but I cannot find it mentioned explicitly anywhere in the documentation and I was not aware of it myself.
/Mats
[EMAIL PROTECTED] wrote:
Why ? :-)
Selon Mats Bengtsson <[EMAIL PROTECTED]>:
Don't ask me why, but if you replace Staff.NoteHead with Voice.NoteHead in your example, it will work.
Also, I recommend to use \override ... \revert instead of explicitly setting the value back to default:
\property Voice.NoteHead \override #'style = #'xcircle c4 c c c \property Voice.NoteHead \revert #'style d4 d d d \grace{d16 d} d4 d d d \property Voice.NoteHead \override #'style = #'xcircle e4 e e e
See http://lilypond.org/doc/v2.0/Documentation/user/out-www/lilypond/Tuning-
objects.html
for more details.
To do a setting for a single note head, use \once \property ...
You can define your own shorthand macro like
xcircle = \notes{ \once \property Voice.NoteHead \override #'style = #'xcircle }
and use it with
\xcircle c4
/Mats
Marco Caliari wrote:
Hi all.
The following example
\property Staff.NoteHead \set #'style = #'xcircle
c4 c c c \property Staff.NoteHead \set #'style = #'default
d4 d d d
\grace{d16 d}
d4 d d d
\property Staff.NoteHead \set #'style = #'xcircle
e4 e e e
does not restore note heads to xcircle (lily 2.1.0). It works if you remove \grace{d16 d}. Is it possible to change a single note head with a command like
c4\xcircle
?
Regards,
_______________________________________________ Bug-lilypond mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-lilypond