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

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

Re: Génération conditionnelle...


From: Olivier Chamley
Subject: Re: Génération conditionnelle...
Date: Sun, 02 May 2010 16:48:16 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4

Le 02/05/2010 01:04, Gilles THIBAULT a écrit :

J'ai bien identifié la façon de faire le test en scheme _#(if (defined?
Musiqueb) (...))_, mais ensuite, je voudrais exprimer ma partition conditionnelle en syntaxe lilypond, pas scheme ! En gros, j'aimerais
bien avoir l'équivalent d'un #ifdef du langage C.
Tu peux mettre du Lilypond à l'intérieur du scheme en l'entourant par
#{ #} mais ça ne marche pas pour \score, avec lequel il faut utiliser entre autre, ly:make-score .
Merci... Ca marche bien unitairement, mais quand j'essaye de faire plusieurs 'book' (je veux générer les partitions à différents formats), ça ne marche plus...

%%%%%%%%%%%%%%
musica = c'1
musicb = d'1     % a décommenter

myBook = #(define-music-function (parser location)()
(let ((a (ly:make-score #{  \musica  #} ))
     (b (and (defined? 'musicb)
             (ly:make-score #{  \musicb  #} ))))
 (collect-scores-for-book parser a)
 (if b (collect-scores-for-book parser b))
 (make-music 'Music 'void #t)))

\book
{
    \paper { #(set-paper-size "a4") }
    \myBook
}

\book
{
    \paper { #(set-paper-size "a5") }
    \myBook
}

\version "2.12.0"
%%%%%%%%%%%%%%%




reply via email to

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