Am 02.12.2011 12:36, schrieb Johan Vromans:
Marc Hohl<m...@hohlart.de> writes:
Has someone an idea
how to create a loop which scans for textA, textB, textC etc. and puts
a command that acts like
\addlyrics for each hit?
This is exactly what I do in my LP templates :)
I just define
highMusic
leadMusic
highWords
highAWords
highBWords
and so on, and the templates will process exactly what has been defined,
leaving out the undefined parts.
I found \ifDefined and friends (attached) helpful to write the templates.
Yes, this looks promising!
So it boils down to something like:
% Add lyrics if requestes.
\ifDefinedThen \leadWords \new Lyrics \lyricsto \voiceName \ifDefined
\leadWords
\ifDefinedThen \leadAWords \new Lyrics \lyricsto \voiceName \ifDefined
\leadAWords
\ifDefinedThen \leadBWords \new Lyrics \lyricsto \voiceName \ifDefined
\leadBWords
\ifDefinedThen \leadCWords \new Lyrics \lyricsto \voiceName \ifDefined
\leadCWords
So it is not exactly scanning, but there's no problem in adding as many
cases as necessary.
Ok, so I need to find out the maximum of stanzas in each processed file
and include
the corresponding \ifDefinedThen lines as mentioned above. From a
prorammer's point
of view, there will be more elegant methods, but this seems to do the job.
Thanks,
Marc
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user