lilypond-user
[Top][All Lists]
Advanced

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

Re: tuplet number placement and ornament


From: David Nalesnik
Subject: Re: tuplet number placement and ornament
Date: Mon, 30 Apr 2012 07:56:43 -0500

Hi again,


Since the number is positioned according to where the bracket would be, you could override 'positions of TupletBracket:

\relative c'' {
   \set tupletSpannerDuration = #(ly:make-moment 1 4)
   \times 2/3 { 
     g8 fis g
     \override TupletBracket #'positions = #'(3.34 . 3.34)
     g\mordent fis g
   }
}


If you want something more automatic, you could try the solution below.  Basically, I'm setting the 'positions of TupletBracket to that of Beam and adding in an offset for correct positioning.  It will work with downstems, too, but there will be a collision if you put the mordent on the middle note.  (Of course the override is unnecessary in that case...)

There's probably a radically simpler solution here, but for what it's worth...

\version "2.15.37"

#(define proc
  (lambda (grob)
    (let* ((first-note
             (car (ly:grob-array->list (ly:grob-object grob 'note-columns))))
           (note-heads
             (ly:grob-array->list (ly:grob-object first-note 'note-heads)))
           (stem (ly:grob-object (car note-heads) 'stem))
           (beam (ly:grob-object stem 'beam))
           (beam-pos (ly:grob-property beam 'positions))
           (padding (ly:grob-property grob 'padding))
           (beam-thick (* 0.5 (ly:grob-property beam 'beam-thickness)))
           (dir (ly:grob-property grob 'direction)))      
         
     (coord-translate beam-pos (* dir (+ beam-thick padding))))))
     
\relative c'' {
   \set tupletSpannerDuration = #(ly:make-moment 1 4)
   \override TupletBracket #'positions = #proc
   %\override TupletBracket #'bracket-visibility = ##t
   \times 2/3 { 
     g8 fis g
     g\mordent fis g
   }
}


reply via email to

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