"Rick Hansen (aka RickH)" <[EMAIL PROTECTED]> writes:
>
> Nicolas,
>
> I'm not the original poster, I was just wondering what this pre-processor
> was, I'm ok with the current relative/absolute note entry with apostrophes.
Oops! sorry.
> I am considering macros to provide more-or-less what you would call
> "conditional \include files" or "smart \includes" that will \include
> different files for songs, paper sizes, code, copyright footers, etc. based
> on condition tests, instead of me having to physically comment/uncomment the
> \include statements I want. This and some other possibilities to generate
> lilypond code more easily for re-use, outside of simple \include files. I
> probably should have started a new thread. I'm getting the results I want
> using all native lp as well, but need some automation in file management now
> that I've got several hundred songs going at once across dozens of
> templates.
The conditionnal includes you can do with LilyPond, which you can trigger
for instance with command line options.
Consider:
includePageLayoutFile =
#(define-music-function (parser location) ()
"If page breaks and tweak dump is not asked, and the file
<basename>-page-layout.ly exists, include it."
(if (not (ly:get-option 'dump-tweaks))
(let ((tweak-filename (format #f "~a-page-layout.ly"
(ly:parser-output-name parser))))
(if (access? tweak-filename R_OK)
(begin
(ly:message "Including tweak file ~a" tweak-filename)
(set! page-layout-parser (ly:clone-parser parser))
(ly:parser-parse-string page-layout-parser
(format #f "\\include \"~a\""
tweak-filename))))))
(make-music 'SequentialMusic 'void #t))
which can be found in the file ly/music-function-init.ly of recent
versions of LilyPond.
nicolas
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user