lilypond-user
[Top][All Lists]
Advanced

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

Re: \keepWithTag #'A {\keepWithTag #'B \music}


From: David Wright
Subject: Re: \keepWithTag #'A {\keepWithTag #'B \music}
Date: Fri, 6 May 2016 22:24:40 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri 06 May 2016 at 10:02:20 (+0200), Gianmaria Lari wrote:
> I thought that
> 
>   \keepWithTag #'(A B) \music
> 
>  and
> 
>   \keepWithTag #'A {\keepWithTag #'B \music}
> 
> would be equivalent. But according to the following test it doesn't.
> 
> 1 Could you please confirm they are not the same?

There's a specific warning against doing this in NM:
"Two or more \keepWithTag filters applied to a single music expression
will cause all tagged sections to be removed, as the first filter will
remove all tagged sections except the one named, and the second filter
will remove even that tagged section. Usually you would rather want to
use a single \keepWithTag command with a list of multiple tags: this
will only remove tagged sections not given in any of the tags."

> % test B
> \score
> {
>   \keepWithTag #'screenOut {\keepWithTag #'letter \music}
> }

After evaluating {\keepWithTag #'letter \music}
anything tagged with "screenOut" has been removed. So you now do step
two which looks like this:

\keepWithTag #'screenOut {stuff without any "screenOut" in it}

The only music that can survive that is what's completely untagged.

I think you should put "letter" and "noLetter" in one tag group and
"screenOut" in another. Each tag group is processed independently so
they don't interfere with one another.

Cheers,
David.



reply via email to

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