lilypond-user
[Top][All Lists]
Advanced

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

Re: context-sensitive or redefinable variables


From: David Kastrup
Subject: Re: context-sensitive or redefinable variables
Date: Mon, 24 Oct 2011 20:21:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Jean-Charles Malahieude <address@hidden> writes:

> Le 24/10/2011 12:57, Frederick Bartlett disait :
>
>> In setting an a apella SATB piece and the (generated) rehearsal
>> piano part, I would like to create two PDF files with different
>> linebreaks.
>>
>> Each part has many occurrences of a variable "midBarBreak" defined as
>> { \bar "" \break } so as to break up the vocal lines at the end of
>> the lines of the set verse. This works just fine.
>>
>> Unfortunately, lilypond seems to process variables upon first reading
>> them, so I can't use the old TeX trick of \let \this \that; nor does
>> \noexpand have a lilypond cognate that I can find. Nor yet do I see
>> any way to incorporate logic into the variable (e.g., if in
>> ChoirStaff, break; if in PianoStaff, ignore). I suspect it's there,
>> somewhere, but I'm not enough of a schemer to see how to use, e.g.,
>> ly:context-parent.
>>
>> So, since TeXish methods don't work, I thought I'd ask if there's a
>> lilypondish way to do this.
>
> What I do in such a case is using "tags". For more information, have a
> look at the Notation Reference, 3.3.2 Different editions from one
> source
>
> http://lilypond.org/doc/v2.14/Documentation/notation/different-editions-from-one-source.html#using-tags

You can do something like
choirBreak = { \tag #'choirBreak << >> }
pianoBreak = { \tag #'pianoBreak << >> }
Then place \choirBreak and \pianoBreak into your \melody.

And then in the ChoirStaff, you say
\pushToTag #'choirBreak { \bar "" \break } \melody
for getting the breaks in, and similarly in the pianostaff.

-- 
David Kastrup




reply via email to

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