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

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

Re: include if exist


From: Sebastien Richard
Subject: Re: include if exist
Date: Wed, 8 Mar 2023 15:42:58 +0000

Bonjour Ben

Exact çà fonctionne à présent

Un grand merci à toi

Cdt,

------
 Filo


From: Ben <ben@eulogia.ch>
Sent: Wednesday, March 8, 2023 09:02
To: Sebastien Richard <richardsgjm@hotmail.com>
Cc: lilypond-user-fr@gnu.org <lilypond-user-fr@gnu.org>
Subject: Re: include if exist
 
Bonjour Filo, 

Chez moi, cela fonctionne:

\version "2.18.2"

includeIfExists =
#(define-void-function (parser location file)(string?)
   (if (file-exists? file)
       (ly:parser-include-string (format #f "\\include \"~A\"\n" file)))
   )

\includeIfExists "/home/oneusername/lilypond/mydrums.ly"

Au plaisir, 

Ben



Le 7 mars 2023 à 21:00, Sebastien Richard <richardsgjm@hotmail.com> a écrit :

Bonsoir à tous,

J'ai récemment mis à jour mon PC (linux mint 18.3 vers 20.3) ce qui a eu pour effet de changer la version de lilypond que j'utilisais.

J'utlisais autrefois ce bout de code qui me permettait d'inclure un fichier seulement s'il existait:

\version "2.18.2"

includeIfExists =
#(define-music-function (parser location file)(string?)
   (if (file-exists? file)
       (ly:parser-include-string parser (format "\\include \"~A\"\n" file)))
   (make-music 'SequentialMusic 'void #t))

\includeIfExists "/home/oneusername/lilypond/mydrums.ly"
\includeIfExists "/home/anotherusername/Drum/Lilypond/mydrums.ly"

La version de Lilypond que j'ai à présent est 2.20.0 et cette function ne "fonctionne" plus:

Parsing.../home/seb/Documents/Drum/Lilypond/Bonham/Bonham (copy).ly:6:8: In procedure ly:parser-include-string in _expression_ (ly:parser-include-string parser (format "\\include \"~A\"
" file)):
/home/seb/Documents/Drum/Lilypond/Bonham/Bonham (copy).ly:6:8: Wrong number of arguments to #<primitive-procedure ly:parser-include-string>

Je n'ai absolument aucune idée de comment corriger cette fonction. Quelqu'un pourrait il m'aider ?

Merci 

------
 Filo


reply via email to

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