lilypond-auto
[Top][All Lists]
Advanced

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

Re: [Lilypond-auto] Issue 4083 in lilypond: \keepWithTag does not nest w


From: lilypond
Subject: Re: [Lilypond-auto] Issue 4083 in lilypond: \keepWithTag does not nest well
Date: Sat, 30 Aug 2014 23:26:23 +0000


Comment #4 on issue 4083 by address@hidden: \keepWithTag does not nest well
https://code.google.com/p/lilypond/issues/detail?id=4083

Tags are a useful concept. The limited logical operations we have on tags makes using them a frustrating exercise in Venn diagrams. \removeWithTag is useful. \keepWithTag causes trouble when we change the set of tags, or add an orthogonal set, mostly because \keepWithTag leaves the matching tags on its output.

We can add potentially better tag-operations, and let people testing the development branch see how well they work in practice.

(a) \keepWithTag A would need to fall-back to its old behavior of removing music with non-matching tags, if the tag A is not declared in any \tagLayer, so that old examples work:
 << {s2*4\p s2*4\>}
    \repeat unfold 8{ ef8 r \tuplet3/2{ ef ef ef } }
    \tag #'part {\repeat percent 8 s2} >>

Making a new function \keepFromLayerOnlyTag lets us try the new method more freely. (The global scope of the layer definitions gives me a nagging worry, as well.)

(c) has a simple version: \keepWithTag A returns the music that was tagged A, but with the tag removed so it does not interfere with later tag-filters.

Tag removal is useful on its own. If the filtering operations on a tagLayer are reasonably confined, such as within a music function, we can clean up that tag layer after use, without defining the layer globally. If A.B.C.D is our tagLayer, \clearTags A \keepWithTag A % maybe \keepWithTag should have done this all along \clearTags A \removeWithTag B.C.D % transparent to other tags, so better than above
 \clearTags B.C.D \removeWithTag A

(b) looks *very* tempting, because it seems to work so intuitively, without requiring a separate declaration of the \tagLayer. In both examples of comment #2 it does what I would have expected a tag-selector function to do. "\chooseWithTag A removes music with tags other than A that are found alongside music tagged A in a parallel or sequential construct." Probably \chooseWithTag A should remove tag-A from its output.

Attachments:
        cleartags.ly  473 bytes

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings



reply via email to

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