Bonjour à tous
Je ne sais pas si le titre est explicite. Je cherche à mettre des nuances entre crochets. Pour l'instant j'utilise \bracket \with-true-dimensions \dynamic f dans un markup. Ca donne un résultat mais qui ne me convient pas vraiment du fait que les nuances ont une apparence italique qui se marie mal avec les crochets bien verticaux.
Du coup je cherche à mettre les crochets en italique, et en code scheme (que je découvre plus ou moins). J'essaye d'abord de reproduire la fonction \bracket mais j'ai du mal à appréhender la taille du crochet (dans le sens y).
Voici là où j'en suis :
#(define-public (bracketify-stencil-italic stil axis thick protrusion padding)
"Add brackets around @var{stil}, producing a new stencil."
(let* ((dimy (cdr (ly:stencil-extent stil axis)))
(dimx (cdr (ly:stencil-extent stil (other-axis axis))))
(alx (- padding))
(aly (/ (- dimy) 2.0))
(blx (- (- padding) protrusion))
(bly (/ (- dimy) 2.0))
(clx (- (- padding) protrusion))
(cly (/ dimy 2.0))
(dlx (- padding))
(dly (/ dimy 2.0))
(arx (+ dimx padding))
(ary (/ (- dimy) 2.0))
(brx (+ dimx (+ padding protrusion)))
(bry (/ (- dimy) 2.0))
(crx (+ dimx (+ padding protrusion)))
(cry (/ dimy 2.0))
(drx (+ dimx padding))
(dry (/ dimy 2.0)))
(ly:stencil-add (make-line-stencil thick alx aly blx bly)
(make-line-stencil thick blx bly clx cly)
(make-line-stencil thick clx cly dlx dly)
stil
(make-line-stencil thick arx ary brx bry)
(make-line-stencil thick brx bry crx cry)
(make-line-stencil thick crx cry drx dry))))
#(define-markup-command (bracketItalic layout props arg)
(markup?)
(let ((th 0.1)
(m (interpret-markup layout props arg)))
(bracketify-stencil-italic m Y th (* 2.5 th) th)))
brackfIt = \markup {
\bracketItalic \with-true-dimensions \dynamic f
}
brackf = \markup {
\bracket \with-true-dimensions \dynamic f
}
brackpIt = \markup {
\bracketItalic \with-true-dimensions \dynamic p
}
brackp = \markup {
\bracket \with-true-dimensions \dynamic p
}
musicA = \relative c'' {
c1_\brackfIt_\brackpIt
c1_\brackf_\brackp
}
\score {
\musicA
}
et voici le résultat :
a gauche ma fonction donne des crochets plus petits alors que j'utilise la même fonction pour la calculer.
Merci pour votre aide.
Sébastien


