\version "2.22.1" %%%%%%%%% Defs %%%%%%%%%% %{ %% noms.ily : % (Avec 'list-ref') bio = #(define-scheme-function (noms) (list?) (let ((pre (list-ref noms 0)) (nom (list-ref noms 1)) (nss (list-ref noms 2)) (dsc (list-ref noms 3))) #{ \markup \override #'(baseline-skip . 2.2) \center-column { \line { $pre \caps $nom } \italic \concat { "(" $nss "–" $dsc ")" } \vspace #.4 } #} )) #(define bach (list "Johann Sebastian" "Bach" "1685" "1750")) % peut également s'écrire de façon lilypondienne : baden = #'("Baden Powell" "de Aquino" "1937" "2000") sor = #'("Fernando" "Sor" "1778" "1839") %} %% noms-alist.ily : % (Avec 'assoc-ref') bio = #(define-scheme-function (noms) (list?) (let ( (pre (assoc-ref noms 'pre)) (nom (assoc-ref noms 'nom)) (als (assoc-ref noms 'als)) (nss (assoc-ref noms 'nss)) (dsc (assoc-ref noms 'dsc))) (if als #{ \markup \override #'(baseline-skip . 2.2) \center-column { \line { $pre \caps $nom } \line \italic { $als } \italic \concat { "(" $nss "–" $dsc ")" } \vspace #.4 } #} #{ \markup \override #'(baseline-skip . 2.2) \center-column { \line { $pre \caps $nom } \italic \concat { "(" $nss "–" $dsc ")" } \vspace #.4 } #} ))) %% alists: bach = #'((pre . "Johann Sebastian") (nom . "Bach") ( nss . "1685") (dsc . "1750")) baden = #'((pre . "Baden Powell") (nom . "de Aquino") ( nss . "1937") (dsc . "2000") (als . "Baden Powell")) sor = #'((pre . "Fernando") (nom . "Sor") ( nss . "1778") (dsc . "1839")) %%% Test : %\include "noms.ily" %\include "noms-alist.ily" <= à retenir \header { title = "Café Lily" composer = \bio #bach arranger = \bio #baden poet = \bio #sor } { c'}