Patrick Karl <[email protected]> writes:

> I'm having a problem trying to learn how to use tags.  The following snippet:
>
> \version "2.14.2"
> music = \relative c' {
>       \tag #' low   {c}
>       \tag #' high {c'}
>       d e f g a b c
> }
>
> \score {\new Staff { \keepWithTag #'low \music }
>           \layout { }
> }
>
> \score {\new Staff { \keepWithTag #'high \music }
>           \layout { }
> }
>
> should produce IMHO two c major scales, the first one starting at
> middle c, and the 2nd one starting at one octave above middle c.
> However, there is a problem with the first scale, namely, the first
> note is middle c, but the rest of the scale is shifted up an octave.
> It almost looks like the c' in the expression tagged "high" has had an
> effect on the score containing \keepWithTag #'low.

Sure.  \relative is a music function turning relative music into
absolute music.  When it does that, both tagged expressions are still in
the music.

> If I switch the two lines, containing \tag, then both scales are
> identical, both starting one octave above middle c.  Again, it looks
> like the c' tagged "high" has an effect on the score containing
> \keepWithTag #'low.
>
> Should that happen?

Most definitely.  Compare with

\version "2.14.2"
music = {
        \tag #' low   {c}
        \tag #' high {c'}
        d e f g a b c
}

\score {\new Staff { \relative c' \keepWithTag #'low \music }
            \layout { }
}

\score {\new Staff { \relative c' \keepWithTag #'high \music }
            \layout { }
}


Here \relative is run _after_ removing tags, and consequently the output
is as you would have expected.

-- 
David Kastrup


_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to