lilypond-user
[Top][All Lists]
Advanced

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

how to detect position of note on stave?


From: Graham King
Subject: how to detect position of note on stave?
Date: Wed, 07 Jan 2015 22:39:11 +0000

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?

\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
            c c c c
            \once \override NoteHead #'stencil =
                #(note-head-musicglyph "noteheads.uM2mensural")
                % #(note-head-musicglyph "noteheads.dM2mensural")
            c1
        }}}

Thanks, in anticipation!

-- Graham King
reply via email to

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