Am 11.03.2014 14:57, schrieb Xavier Noria:
I am writing a score that has a few notes with cross heads. It would be
helpful to define \cross such that

    \cross { c8 c8 c8 }

would expand to:

    \override NoteHead.style = #'cross
    c8 c8 c8
    \revert NoteHead.style

Is that possible?

Yes:

cross =
#(define-music-function (parser location music)(ly:music?)
   #{
     \temporary\override NoteHead.style = #'cross
     $music
     \revert NoteHead.style
   #}
   )

{
  \cross { c8 c8 c8 }
}

(I don't know when (recently) the \temporary was included (I think somewhere in 2.17). This ensures that NoteHead.style won't be reverted to its _default_ value but to the value that was active _immediately before_.

HTH
Urs


_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to