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

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

Re: slurs entre crochets


From: Seventies
Subject: Re: slurs entre crochets
Date: Tue, 24 Mar 2015 11:40:37 -0700 (MST)

J'ai retrouvé ceci sur les soufflets entre parenthèses, entre crochets, ...

% Mettre un soufflet entre parenthèses (ou tout autre signe)

hairpinBetweenText =
#(define-music-function (parser location leftText rightText) (markup?
markup?)
   #{
     \once \override Hairpin #'stencil =
     #(lambda (grob)
        (let* ((orig (ly:grob-original grob))
               (siblings (if (ly:grob? orig)
                             (ly:spanner-broken-into orig)
                             '()))
               (hairpin-stencil (ly:stencil-aligned-to
                                 (ly:hairpin::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! hairpin-stencil
                    (ly:stencil-combine-at-edge
                     left-addition
                     X RIGHT
                     hairpin-stencil
                     0)))
          (if (or (null? siblings)
                  (eq? grob (car (reverse siblings))))
              (set! hairpin-stencil
                    (ly:stencil-combine-at-edge
                     hairpin-stencil
                     X RIGHT
                     right-addition
                     0.6)))
          hairpin-stencil))
   #})

% utilisation :
parenthesizedHairpin = \hairpinBetweenText \markup "(" \markup ")"
bracketedHairpin = \hairpinBetweenText \markup "[" \markup "]"
shortenedHairpin = \hairpinBetweenText \markup " " \markup " "

\parenthesizedHairpin
c16\< d e f g a b c d e f g a\!
% ne vaut que pour le soufflet suivant la note concernée


Je n'ai pas encore essayé en remplaçant le stencil hairpin par slur, ça
devrait fonctionner.
Si j'ai un moment ce soir, je teste, car c'est parfois bien utile.

Cordialement,

Jean-François




--
View this message in context: 
http://lilypond-french-users.1298960.n2.nabble.com/slurs-entre-crochets-tp7582592p7582598.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]