Hi Graham,

On Wed, Jan 7, 2015 at 4:39 PM, Graham King <lilyp...@tremagi.org.uk> wrote:

>  I'm trying to replace a note with one of two special glyphs, depending
> on the note's position on the stave:  if on the third line or above, stem
> down, otherwise stem up.  Is it possible to extend the following code to
> detect automatically (and independently of clef or transposition) which
> glyph should be chosen?
>

Sure--try this:


\version "2.19.5"

#(define ((note-head-musicglyph name) grob)
   (grob-interpret-markup grob (make-musicglyph-markup name)))

\score {
  \shiftDurations #-1 #0 {
    \relative c' {
      \time 4/2
      \override NoteHead #'stencil =
      #(lambda (grob)
         (let ((pos (ly:grob-property grob 'staff-position)))
           (if (>= pos 0)
               (note-head-musicglyph "noteheads.dM2mensural")
               (note-head-musicglyph "noteheads.uM2mensural"))))
      c c'
}}}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to