[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tag issue
From: |
Thomas Morley |
Subject: |
Re: tag issue |
Date: |
Sat, 13 Apr 2019 13:06:10 +0200 |
Am Sa., 13. Apr. 2019 um 12:20 Uhr schrieb Gianmaria Lari
<address@hidden>:
>
> Harm, if I understood corretly the code:
>
> \version "2.18.2"
> \tagGroup #'(testOne testTwo)
>
> music = {
> \tag #'testOne a
> \tag #'testTwo b
> }
> \keepWithTag #'testOne {\music~\music}
>
>
> is converted to:
>
> \keepWithTag #'testOne {
>
> \tag #'testOne a
> \tag #'testTwo b
> ~
> \tag #'testOne a
> \tag #'testTwo b
>
> }
>
>
> But then why lilypond removes the tie? Shouldn't just remove the expression
> following testTwo that is "b" ?
Some steps back.
(1) How are Ties done in LilyPond?
For note-events a TieEvent is added to the note's articulations-property, see:
\void \displayMusic b4~
(2) How are tags done?
For a single note-event the symbol provided by the \tag-command is
added to the list of the tags-property, see:
\void \displayMusic \tag #'tst b4~
Now you have a note-event with a Tie, tagged with 'tst.
If you now apply \keepWithTag #'non-tst to this expression only stuff
with 'non-tst tag will be kept.
In this example empty-music remains, see:
\void \displayMusic \keepWithTag #'non-tst \tag #'tst b4~
In short, there is no single Tie-expression in the music, the Tie is
always added to the articulations (or elements, if we have an
event-chord), _before_ \keepWithTag works.
At least with the demonstrated usage
You need to ensure \keepWithTag is applied before the Tie is done.
I already showed the most simple method:
music = {
\tag #'testOne b
\tag #'testTwo b^"M"
}
{ \keepWithTag #'testOne \music ~ \keepWithTag #'testOne \music }
Also working:
tst-I-mus = \keepWithTag #'testOne \music
tst-II-mus = \keepWithTag #'testTwo \music
{ \tst-I-mus ~ \tst-I-mus }
{ \tst-II-mus ~ \tst-II-mus }
HTH,
Harm