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

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

Re: alignement opus et piece


From: Eluze
Subject: Re: alignement opus et piece
Date: Fri, 28 Sep 2012 06:24:48 -0700 (PDT)

une dernière question à ce sujet:

il y a la possibilité d'écrire le code LilyPond dans une macro/fonction
scheme de la façon 

#{ … code LilyPond … #}

ce qui serait certainement bien venu chez les utilisateurs qui veulent
adapter cette fonction à leur goût.

#(define-markup-command (piece-and-opus layout props label arg1 arg2) 
       (symbol? markup? markup?) 
(let* ((space (+ (ly:output-def-lookup layout 'piece-and-opus-hspace 0) 
                  (ly:output-def-lookup layout 'indent 0))) 
        (stencil-even (interpret-markup layout props 
            #{ \markup \fill-line {$arg1 \line { $arg2 \hspace #space }}#}
            ))
        (stencil-odd (interpret-markup layout props 
            #{ \markup \fill-line {\line {\hspace #space $arg2 } $arg1 } #}
            ))
        (stencil-both (ly:stencil-add stencil-even stencil-odd))) 
   (ly:make-stencil 
     `(delay-stencil-evaluation 
        ,(delay (ly:stencil-expr 
           (let* ((table (ly:output-def-lookup layout 'label-page-table)) 
                  (page-number (if (list? table) 
                    (assoc-get label table) 
                    #f))) 
             (if (even? page-number) stencil-even stencil-odd))))) 
     (ly:stencil-extent stencil-both X)(ly:stencil-extent stencil-both Y))))

penses-tu qu'on pourrait ajouter cette fonction au LSR?

Eluze




--
View this message in context: 
http://lilypond-french-users.1298960.n2.nabble.com/alignement-opus-et-piece-tp7578429p7578506.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]