> I found out that using
> #(ly:parser-parse-string (ly:parser-clone parser) "\\include \"01.ily\"") 
> _does_ actually work, but not when the included file contains variable
> definitions (e.g. "music = ...").
> Still no ideas?
> 
Perhaps something like that :


%%%%%%%%%%

\version "2.18.2"

file = #(let((myfile "test.ly"))
(if (file-exists? myfile)
       myfile
       "emptyfile.ly"))

\include #file

%%%%%%%%%

which seems to works, but you need to create an empty file "emptyfile.ly" 
somewhere in your PATH.
Alternatively, this seems also to work :

...
(if (file-exists? myfile)
       myfile
       ""))

but you will get an advertisement for the \include ""


-- 
Gilles

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to