lilypond-user
[Top][All Lists]
Advanced

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

Re: quoted tuplet bracket within staff


From: Lukas-Fabian Moser
Subject: Re: quoted tuplet bracket within staff
Date: Fri, 26 Nov 2021 16:19:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

For a general solution, one could probably write a callback for the positions 
property.
I was hoping to use #'outside-staff-priority to try to allow the tuplet to 
float into the staff automatically, but gave up after a few minutes of not 
finding the right incantation…

I never really understood the outside-staff behaviour, to be honest. It's well possible that there's an elegant solution that just tells LilyPond to go ahead and put the tuplet bracket into the staff.

A poor man's automated solution might be:

\version "2.23.4"

x = { r2 \tuplet 3/2 { g4 a b } r2 \tuplet 3/2 { c'4 a g } }

\addQuote "qx" \x

{
  r2 \cueDuring #"qx" #DOWN {
    \override CueVoice.TupletBracket.positions =
    #(lambda (grob)
       (define (get-top direction)
         (cdr (ly:grob-property
               (ly:spanner-bound grob direction)
               'Y-extent)))
       (cons (+ (get-top LEFT) 1.5) (+ (get-top RIGHT) 1.5)))
    \override CueVoice.TupletBracket.direction = #UP

    { r2 r2 r2 }
  }
}

Lukas




reply via email to

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