lilypond-user
[Top][All Lists]
Advanced

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

Re: change note heads according to their current measure position?


From: David Nalesnik
Subject: Re: change note heads according to their current measure position?
Date: Sat, 14 Feb 2015 11:15:12 -0600

Hi Marc,

On Sat, Feb 14, 2015 at 10:39 AM, Marc Hohl <address@hidden> wrote:

IIRC, there is no way to obtain the current measure position from the NoteHead grob itself ...

You can find the location by finding the PaperColumn grob which is associated with the NoteHead.  The properties 'rhythmic-location or 'when contain timing imformation.  Here's a sketch:

\version "2.19.15"

#(define (get-paper-column grob)
   (if (not (ly:grob? grob))
       (ly:message "column not found")
       (if (grob::has-interface grob 'paper-column-interface)
           grob
           (get-paper-column (ly:grob-parent grob X)))))

#(define (return-location grob)
   (let ((col (get-paper-column grob)))
     (display (ly:grob-property col 'rhythmic-location))
     (newline)))

{
  % after-line-breaking works too
  \override NoteHead.before-line-breaking = #return-location
  c'8 d' e' f' g'2
  c'1
}
 
Hope this gets you started.

--David

reply via email to

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