|
From: | Pierre Perol-Schneider |
Subject: | Re: \cresc entre parenthèses |
Date: | Mon, 9 Sep 2019 08:58:01 +0200 |
Merci Pierre c’est ce que je devais faire. Parfait
Amcalement
Daniel Bernair
De : lilypond-user-fr De la part de Pierre Perol-Schneider
Envoyé : dimanche 8 septembre 2019 11:09
À : Daniel Bernair (Belgacom.net) <address@hidden>
Cc : lilypond-user-fr <address@hidden>
Objet : Re: \cresc entre parenthèses
Oui, c'est normal, il s'agit de deux fonctions bien différentes.
Une solution (simple) :
\version "2.19.83"
pCresc = #(define-event-function (parser location) ()
#{
\tweak bound-details.left.text \markup\concat { \lower #.1 "(" "cresc." }
\tweak bound-details.right-broken.text ##f
\tweak bound-details.left-broken.text ##f
\tweak bound-details.right.text \markup \lower #.5 " )"
\cresc
#})
pDresc = #(define-event-function (parser location) ()
#{
\tweak bound-details.left.text \markup\concat { \lower #.1 "(" "decresc." }
\tweak bound-details.right-broken.text ##f
\tweak bound-details.left-broken.text ##f
\tweak bound-details.right.text \markup \lower #.5 " )"
\decresc
#})
%% Tests :
{ c'1*10 \cresc \break c' c'1\! }
{ c'1*10 \pCresc \break c' c'1\! }
{ c'1*10 \decresc \break c' c'1\! }
{ c'1*10 \pDresc \break c' c'1\! }
Cordialement,
Pierre
Le dim. 8 sept. 2019 à 09:51, Daniel Bernair (Belgacom.net) <address@hidden> a écrit :
Merci pour les infos, Pierre, cependant si cela fonctionne bien avec \< … \ ! ou \> … \ ! avec \cresc …\ ! et \decr .. \ ! les parentèses ne sont pas imprimées.
Amicalement,
Daniel Bernair
De : Pierre Perol-Schneider
Envoyé : samedi 7 septembre 2019 19:31
À : Daniel Bernair (Belgacom.net) <address@hidden>
Cc : lilypond-user-fr <address@hidden>
Objet : Re: \cresc entre parenthèses
Bonsoir Daniel,
Je n'ai pas le temps de suite mais jette un coup d’œil ici: http://lilypond.1069038.n5.nabble.com/Hairpins-brackets-and-dynamics-td212153.html#a212156
Ce qui donne :
\version "2.19.81"
#(define (hairpin-between-text kern left-text right-text)
(lambda (grob)
(let* ((v-centered-left-text
(ly:stencil-aligned-to
(grob-interpret-markup grob left-text) Y CENTER))
(left-text-x-ext (ly:stencil-extent v-centered-left-text X))
(v-centered-right-text
(ly:stencil-aligned-to
(grob-interpret-markup grob right-text) Y CENTER))
(right-text-x-ext (ly:stencil-extent v-centered-right-text X))
(prev-shorten-pair
(ly:grob-property grob 'shorten-pair '(0 . 0)))
(thick
(ly:grob-property grob 'thickness 1))
(line-thick (ly:staff-symbol-line-thickness grob))
(actual-thick (* thick line-thick))
(shorten
(+ (* 2 kern)
(cdr right-text-x-ext)
(cdr left-text-x-ext)
(- (* 2 actual-thick)))))
(ly:grob-set-property! grob 'shorten-pair
(coord-translate
prev-shorten-pair
(cons 0 shorten)))
(let* ((v-centered-hairpin
(ly:stencil-aligned-to
(ly:hairpin::print grob) Y CENTER))
(hairpin-x-ext (ly:stencil-extent v-centered-hairpin X)))
(ly:stencil-translate-axis
(ly:stencil-add
(ly:stencil-translate-axis
v-centered-left-text
(-
(car hairpin-x-ext)
(cdr left-text-x-ext)
actual-thick)
X)
(ly:stencil-translate-axis
v-centered-hairpin
(- kern actual-thick)
X)
(ly:stencil-translate-axis
v-centered-right-text
(+
(cdr hairpin-x-ext)
(* 2 kern))
X))
(cdr left-text-x-ext)
X)))))
hairpinBetweenText =
#(define-music-function (space text-left text-right)
((number? 0.6) markup? markup?)
#{
\once \override Hairpin.stencil =
#(hairpin-between-text space text-left text-right)
#})
% Ex :
\relative c''{
\override Hairpin.to-barline = ##f
%\override Hairpin.shorten-pair = #'(.4 . 0) %% <= à ajuster
\hairpinBetweenText "(" ")"
c1~\< c\!
\hairpinBetweenText "[" "]"
a1\> b c4 b c a a1\!
\hairpinBetweenText "(" ")"
c,1\< c d e\!
}
Si j'ai le temps plus tard, je regarderai pour le \cresc etc.
Cordialement,
Pierre
Le sam. 7 sept. 2019 à 16:11, Daniel Bernair (Belgacom.net) <address@hidden> a écrit :
Bonjour à toutes et tous.
Dans mes outils j’ai enregistrer cette fonction qui permet de mettre entre parenthèses un crescendo, decrescendo du style \< …\ ! ou \> …\ !
Cela fonctionne bien mais pas avec \cresc …\ ! ou \decr … \ !
Cela revient quelques fois dans ma partition Comment faire ?
Voici le code de la fonction :
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))
#})
parenthesizedHairpin = \hairpinBetweenText \markup \fontsize #3 "( " \markup
\fontsize #3 ")" %adapter fontsize en fonction des goûts
\relative c''{
\once \override Hairpin.extra-offset = #'(-0.4 . 0)
c1~\< c\!
\once \override Hairpin.extra-offset = #'(0.5 . -1)
\parenthesizedHairpin
a1\> b c4 b c a a1\!
%il est possible que le
%0.5 puisse être inclus plus haut dans la définition
\once \override Hairpin.extra-offset = #'(0.5 . -0)
\parenthesizedHairpin
c,1\< c d e\!
}
Merci de votre aide.
Daniel Bernair
This email has been scanned by BullGuard antivirus protection.
For more info visit www.bullguard.com
_______________________________________________
liste de diffusion lilypond-user-fr
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user-fr
This email has been scanned by BullGuard antivirus protection.
For more info visit www.bullguard.com
This email has been scanned by BullGuard antivirus protection.For more info visit www.bullguard.com
[Prev in Thread] | Current Thread | [Next in Thread] |