Paul Morris <p...@paulwmorris.com> writes: > Hi Jan-Peter, > > > Jan-Peter Voigt wrote >> to use a file for including definitions and also to compile it >> stand-alone, I use a command to conditionally create the score. It is >> integrated in a system to execute templates: >> https://github.com/openlilylib/snippets/tree/master/templates/lalily >> >> Attached is a short example, which conditionally compiles (without the >> template framework). > > Wow, thanks, this is a nice solution! So the "conditional-compile.ly" file > is the child file (for a single movement) and the "conditional-compile2.ly" > file is the parent file (that contains several movements). Below is a > version of "conditional-compile.ly" where I added some logging commands if > that helps anyone else see how it's working. > > Your "doScore" function seems to be a workaround for the limitation > that music functions can't return a score.
That's not a "limitation". A music function returning a score makes as little sense as an integer function returning a complex number. If you want to return a score, don't use a music function. > (I tried to rewrite it as a music function but got "error: music > function cannot return #<Score>". Scheme functions exist. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user