lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wrapping music


From: Xavier Noria
Subject: Re: wrapping music
Date: Tue, 11 Mar 2014 15:08:47 +0100

Awesome, thanks very much!


On Tue, Mar 11, 2014 at 3:02 PM, Urs Liska <address@hidden> wrote:
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
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

[Prev in Thread] Current Thread [Next in Thread]