lilypond-user-fr
[Top][All Lists]
Advanced

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

Re: Liaisons entre parenthèses


From: JMarc
Subject: Re: Liaisons entre parenthèses
Date: Tue, 18 Feb 2014 04:31:09 -0800 (PST)

Bon c'est pas super élégant et ça ne fontionne que pour 2 notes liées (pas
sur 3 ou plus), mais ça peut dépanner. Il s'agit de l'adaptation du code sus
cité (vous pensez bien que je n'ai pas pu pondre cela à partir de rien ).

A bientôt !
JMarc

\version "2.17.22"

tieBetweenText =
#(define-music-function (parser location leftText rightText) (markup?
markup?)
   #{
     \once \override Tie #'stencil =
     #(lambda (grob)
        (let* ((orig (ly:grob-original grob))
               (siblings (if (ly:grob? orig)
                             (ly:spanner-broken-into orig)
                             '()))
               (tie-stencil (ly:stencil-aligned-to
                                 (ly:tie::print grob) Y CENTER))
               (left-addition (ly:stencil-aligned-to
                               (grob-interpret-markup grob leftText) Y
CENTER))
               (right-addition (ly:stencil-aligned-to
                                (grob-interpret-markup grob rightText) Y
CENTER)))
          (if (or (null? siblings)
                  (eq? grob (car siblings)))
              (set! tie-stencil
                    (ly:stencil-combine-at-edge
                     left-addition
                     X RIGHT
                     tie-stencil
                     0)))
          (if (or (null? siblings)
                  (eq? grob (car (reverse siblings))))
              (set! tie-stencil
                    (ly:stencil-combine-at-edge
                     tie-stencil
                     X RIGHT
                     right-addition
                     0.6)))
          tie-stencil))
   #})


parenthesizedTie = \tieBetweenText \markup \fontsize #2 "( " \markup
\fontsize #2 ")" %adapter fontsize en fonction des goûts

\relative c''{
  c1~ c
  \once \override Tie.extra-offset = #'(0.5 . 2)
  \parenthesizedTie
  c1~ c
  \once \override Tie.extra-offset = #'(0.5 . -4.5) %il est possible que le
0.5 puisse être inclus plus haut dans la définition
  \parenthesizedTie
  c,1~ c  
}



-----
JMarc LEGRAND
Editions IN NOMINE
--
View this message in context: 
http://lilypond-french-users.1298960.n2.nabble.com/Liaisons-entre-parentheses-tp7580957p7580963.html
Sent from the LilyPond French Users mailing list archive at Nabble.com.



reply via email to

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