lilypond-user
[Top][All Lists]
Advanced

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

Re: Issue on vertical spacing of a TupletBracket


From: Jean Abou Samra
Subject: Re: Issue on vertical spacing of a TupletBracket
Date: Fri, 10 Dec 2021 10:09:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1

Le 10/12/2021 à 01:13, Paolo Prete a écrit :
Hello,

please look at this snippet (tested with 2.22.0):

%%%%%
{
\time 5/4
\override TupletBracket.direction = #UP
\tuplet 3/2 { a'' a'' ais''-.}
s
\tuplet 3/2 { \once \hide Accidental a'' a'' ais''}
}
%%%%%

As you can see, the vertical gap between the staccato dot and the tuplet bracket is shorter than the gap between the same bracket and the accidental; however, this is not taken into account and the result is visually faulty.
Is there a way to fix this?


Try the workaround given here:

https://gitlab.com/lilypond/lilypond/-/issues/3766#note_623977182


\version "2.22.1"

#(define (Tuplet_accidental_support_engraver context)
   (let ((brackets (make-hash-table))
         (ending-brackets '())
         (accidentals '()))
     (make-engraver
       (acknowledgers
         ((tuplet-bracket-interface engraver grob source-engraver)
            (hashq-set! brackets grob #t))
         ((accidental-interface engraver grob source-engraver)
            (set! accidentals (cons grob accidentals))))
       (end-acknowledgers
         ((tuplet-bracket-interface engraver grob source-engraver)
            (set! ending-brackets (cons grob ending-brackets))))
       ((stop-translation-timestep engraver)
          (hash-for-each
            (lambda (bracket dummy)
              (for-each
                (lambda (accidental)
                  (ly:pointer-group-interface::add-grob
                    bracket
                    'scripts
                    accidental))
                accidentals))
            brackets)
          (for-each
            (lambda (bracket)
              (hashq-remove! brackets bracket))
            ending-brackets)
          (set! accidentals '())))))

\layout {
  \context {
    \Voice
    \consists #Tuplet_accidental_support_engraver
  }
}


%%%%%
{
\time 5/4
\override TupletBracket.direction = #UP
\tuplet 3/2 { a'' a'' ais''-.}
s
\tuplet 3/2 { \once \hide Accidental a'' a'' ais''}
}
%%%%%


Best,
Jean



reply via email to

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