Hi Jay, On Thu, Sep 18, 2014 at 7:28 AM, David Nalesnik <david.nales...@gmail.com> wrote:
> > > On Thu, Sep 18, 2014 at 7:01 AM, David Nalesnik <david.nales...@gmail.com> > wrote: > > >> >> > >> >> Now, if you want to have LilyPond detect the note durations and make the >> fontsize decisions for you, I don't believe you'll be able to use the >> NoteNames grob as it stands. >> > > I mean NoteName grob, of course. > > Now that's not true, it turns out... \version "2.18.2" music = \relative c' {c2 d e f g a b c c b a g f e d c} newnames = #`(("c" . "S") ("d" . "R") ("e" . "G") ("f" . "M") ("g" . "P") ("a" . "D") ("b" . "N") ) myNoteNames = #(lambda (grob) (let* ( ;; bindings (default-name (ly:grob-property grob 'text)) (new-name (assoc-get default-name newnames)) (cause (event-cause grob)) (duration (ly:prob-property cause 'duration)) (duration-log (ly:duration-log duration)) (size (case duration-log ((2) -2) ((3) -4) (else 1))) ) ;; body (ly:grob-set-property! grob 'text (markup #:fontsize size new-name)) (ly:text-interface::print grob) ) ) \new Staff { << \new Voice { \music \shiftDurations #1 #0 {\music } \shiftDurations #2 #0 {\music \music } } \context NoteNames { \override NoteName.stencil = #myNoteNames \music \shiftDurations #1 #0 {\music } \shiftDurations #2 #0 {\music \music } } >> }
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user