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

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

Re: Notation d'un barré pour une seule note ou accord


From: Jean Abou Samra
Subject: Re: Notation d'un barré pour une seule note ou accord
Date: Mon, 26 Dec 2022 16:54:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

Le 24/12/2022 à 09:56, Simon Martineau a écrit :


Merci beaucoup Pierre !

Voilà donc ma fonction qui me convient très bien, je me demande juste si il n’y a pas moyen d’utiliser (let (barre-markup (...))), je trouve ça un peu dommage de réécrire les mêmes lignes avec les \tweak à l’identique. Je vais faire quelques essais !



Oui, bien sûr :

\version "2.24.0"

startB =
#(define-event-function (partial fretnum)
   ((string? "") number? )
   (let ((barre-event
          #{
              \tweak style #'line
              \tweak thickness #1.5
              \tweak bound-details.left.stencil-align-dir-y #0
              \tweak bound-details.left.padding 0
              \tweak bound-details.left.attach-dir -1
              \tweak bound-details.left-broken.text ##f
              \tweak bound-details.left-broken.attach-dir -1
              \tweak bound-details.right.padding 0
              \tweak bound-details.right.attach-dir 1
              \tweak bound-details.right-broken.text ##f
              \tweak bound-details.right.text
                \markup
                  \with-dimensions #'(0 . 0) #'(-.3 . 0)
                  \draw-line #'(0 . -0.4)
              \startTextSpan
          #}))
     (if (string-null? partial)
         #{
            \tweak bound-details.left.text
              \markup
                \fontsize #-1 \normal-text \bold \concat {
                #(format #f "~@r" fretnum)
                \hspace #.1
              }
            #barre-event
         #}
         #{
            \tweak bound-details.left.text
              \markup
                \fontsize #-1 \normal-text \bold \concat {
                #(format #f "~@r" fretnum)
                   \lower #.3 \fontsize #-4.2 #partial
                   \hspace #.1 }
            #barre-event
         #})))


Attention, il y a bien deux paires de parenthèses autour de
« barre-event ... » dans « (let ((barre-event ...)) ...) »,
comme expliqué dans

https://tutoriel-scheme.readthedocs.io/fr/latest/variables-locales.html#parentheser-un-let

Cordialement,
Jean

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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