lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conditionally including lyrics


From: Jan-Peter Voigt
Subject: Re: Conditionally including lyrics
Date: Fri, 02 Dec 2011 12:33:25 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110921 Lightning/1.0b2 Thunderbird/3.1.15

Hello Marc,

for me this problem leads to the question how to name variables and how store music. I am using my own functions to store music and typeset it into a template. If this template is capable of some stanza option, it can produce Lyric contexts as needed. The file attached is my current next-version-development-alpha-stuff. If you look into it, you will first see a lot lot lot of scheme code. At the end of the file is a little example, that does not use stanzas right now - so this is more an invitation to develop.
The key functions are:

\putTemplate #'(template path) #(define-music-function (parser location piece options)(list? list?) #{ ... #} \setDefaultTemplate #'(music path) #'(template path) #'((option . a-list)) % sets current music-path context \putMusic #'(rel music path) { [the music] } % stores music relative to current music-path \createScore #'(rel music path) % instantiates music relative to current music-path (will most times be #'() )

If this is of interest for you, I could explain it more deeply and do changes from the comments of someone else.

Cheers,
Jan-Peter

Am 02.12.2011 11:26, schrieb Marc Hohl:
Hello list,

I have a lot of small music pieces with several stanzas which I store
like this

textA = \lyricmode {
  \set stanza = "1. "
  this is the first stan -- za.
}

textB = \lyricmode {
  \set stanza = "2. "
  and this one is the se -- cond.
}

textC = ...

together with the melody in files called data01.ily, data02.ily etc.

Now these files should be processed by some kind of generator file, which consists of something like this:

\include "data01.ily"
\score {
  \new Staff {
    \new Voice { \melody }
    \addlyrics { \textA }
    \addlyrics { \textB }
    \addlyrics { \textC }
  }
}

Now the data files contain different numbers of stanzas, and ideally, the generator file should be intelligent enough to include all stanzas which are present. 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?

I could do this with some shell scripting, but a lilypondish solution would be better to
maintain, I think.

Thanks in advance,

Marc



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


Attachment: PutGetTree-class.ly
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]