Flaming Hakama by Elaine <ela...@flaminghakama.com> writes: > On Wed, Dec 6, 2017 at 8:33 AM, David Kastrup <d...@gnu.org> wrote: > >> Flaming Hakama by Elaine <ela...@flaminghakama.com> writes: >> >> > Here is an illustration of using tags for this purpose. >> > >> > Note that there are other approaches, even using tags. >> > This approach uses the \keepWithTag within each \score >> > to distinguish Part vs Score, PDF vs MIDI, the specific >> > instrument, and each segment the piece. >> >> Really, I'd use >> >> \tagGroup SegmentA,SegmentB,SegmentC >> \tagGroup PDF,MIDI >> \tagGroup Part,Score >> >> with this so that you don't have to list unrelated tags (like >> SegmentA,SegmentB,SegmentC) whenever you use \keepWithTag for one >> purpose. >> > > Thanks for the help. I have to admit, however, I totally don't understand > this application of \tagGroup. > > Maybe \tagGroup has more useful use cases for \removeWithTag?
No. It's really just for \keepWithTag so that \keepWithTag MIDI does not throw away things things tagged with \tag SegmentA (and nothing else). > Using \keepWithTag already has the effect of excluding any tagged > content that isn't among the tags specified. Which is exactly what \tagGroup avoids: is excludes any _related_ tagged content, but does not consider tags outside of the respective \tagGroup . > What is gained by specifying a group of tags to ignore, since they are > already being ignored? They aren't ignored. \tag SegmentA ... gets removed by \removeWithTag MIDI unless you separate MIDI and SegmentA into different tag groups. > In the example in the docs, using tagGroup produces the same result as not > using it: > > http://lilypond.org/doc/v2.19/Documentation/notation/different-editions-from-one-source > > \version "2.19.80" > > music = \relative { > \tag #'violinI { c''4^"violinI" c c c } > \tag #'violinII { a2 a } > \tag #'viola { e8 e e2. } > \tag #'cello { d'2 d4 d } > R1^"untagged" > } > > \new Voice { > \mark "No tagGroup" > \keepWithTag #'violinI > \music > } > > \new Voice { > \mark "With tagGroup" > \tagGroup #'(violinI violinII viola cello) > \keepWithTag #'violinI > \music > } > > > So, what is \tagGroup really doing in this case? Ouch. Nothing. The example is junk because it only contains a single specified tag group (and essentially all tags not in a specified tag group are implicitly in a single tag group anyway). The original documentation I wrote contained no examples. This was added as commit c5847c9329abba798fb15bb336c7247ab149660b Author: James Lowe <pkx1...@gmail.com> Date: Thu Feb 18 10:43:09 2016 +0000 Doc: NR - input.itely: Various improvements Issue 4677 A variety of nitpicks and improvements reported by Federico Bruni Updated information and included a new @lilypond example for \KeepWithTag. Some spelling corrections and some simple rewording of a few paragraphs for clarity (deleted repeated words, removed personal pronouns etc.). Moved a comment (@c) outside of an @example so as to not cause confusion to readers. and obviously I shirked properly reviewing it. Basically \tagGroup only makes sense if you at least have two different tag groups (one may be the implied default one): only then does the behavior start to differ. Of course it also makes sense to use in style files using tags internally: putting the internally used tags in a tag group means that they won't interfere with tags the user uses himself in his source code. > If you explain it to me, I can try to come up with a better example > for the docs. It's for the case where you are dealing with orthogonal tags: \keepWithTag violinI should not throw away a sequence marked only \tag MIDI because MIDI and violinI have nothing to do with one another. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user