|
From: | Marc Hohl |
Subject: | Re: change note heads according to their current measure position? |
Date: | Tue, 24 Feb 2015 17:58:02 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
Hi David, thanks for your info – and your work in this area! Am 24.02.2015 um 15:29 schrieb David Nalesnik:
Hi Marc, On Sat, Feb 14, 2015 at 11:15 AM, David Nalesnik <address@hidden <mailto:address@hidden>> wrote: Hi Marc, On Sat, Feb 14, 2015 at 10:39 AM, Marc Hohl <address@hidden <mailto: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))))) In current master, there is now a function ly:item-get-column which returns the associated column.. (This will need to wait for the release of 2.19.16.)
Yep, I replaced get-paper-column with ly:item-get-column in my code and it works like a charm!
#(define (return-location grob) (let ((col (get-paper-column grob))) (display (ly:grob-property col 'rhythmic-location)) (newline))) There are currently two functions being reviewed which will return location data. The above would be covered by grob::rhythmic-location (and there would be no need of looking for a paper column separately). https://code.google.com/p/lilypond/issues/detail?id=4294
That's great news, I highly appreciate these new functions! Thanks a lot, Marc
--David
[Prev in Thread] | Current Thread | [Next in Thread] |