|
From: | Marc Hohl |
Subject: | Re: Conditionally including lyrics |
Date: | Fri, 02 Dec 2011 17:41:02 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 |
Am 02.12.2011 12:36, schrieb Johan Vromans:
Marc Hohl<address@hidden> 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!
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 pointSo 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.
of view, there will be more elegant methods, but this seems to do the job. Thanks, Marc
[Prev in Thread] | Current Thread | [Next in Thread] |