lilypond-user
[Top][All Lists]
Advanced

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

RE: TupletNumber direction


From: Daniel Rosen
Subject: RE: TupletNumber direction
Date: Sun, 11 Nov 2012 21:36:53 +0000

Fantastic. I had a feeling that it would be a relatively simple function (it 
certainly appears to be), but I know absolutely nothing about Scheme. I'll have 
to read the Extending manual one of these days. 

DR


-----Original Message-----
From: David Nalesnik [mailto:address@hidden 
Sent: Sunday, November 11, 2012 3:53 PM
To: Daniel Rosen; David Kastrup
Cc: address@hidden
Subject: Re: TupletNumber direction

On Sun, Nov 11, 2012 at 2:13 PM, Daniel Rosen <address@hidden> wrote:
> I guess I should have been more clear, but I was in a rush. What I'm actually 
> looking for is a function to have tuplet numbers ALWAYS appear on the note 
> head side, regardless of stem direction.

You could do something like this, which looks at the direction of the first 
stem in the tuplet to determine where the note head is:

\relative c'' {
  \override TupletBracket #'direction =
  #(lambda (grob)
    (let* ((note-column (ly:grob-parent grob X))
           (stem (ly:grob-object note-column 'stem))
           (stem-direction (ly:grob-property stem 'direction)))
      (if (= UP stem-direction)
          DOWN
          UP)))

  \times 2/3 { c8 c c }
  \times 2/3 { c,8 c c }
  \times 2/3 { c'8 c c }
  \times 2/3 { c,8 c c }
}

This doesn't address the issue of the stem direction changing during the course 
of the tuplet (i.e., for a "kneed beam").

On Sun, Nov 11, 2012 at 2:44 PM, David Kastrup <address@hidden> wrote:
> Daniel Rosen <address@hidden> writes:
>
>> Also, I'm a little confused as to why \override TupletNumber 
>> #'direction = #-1 isn't working just as well in the meantime.
>
> Because it is not consulted?
>
> \version "2.16.0"
> \new Voice {
>   \times 2/3 { c'8 c' c' }
>   \override TupletBracket #'direction = #DOWN
>   \times 2/3 { c'8 c' c' }
> }
>

Yes--the tuplet number is pulled along by the bracket, even though there is 
none visible here.

HTH,
David

reply via email to

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