lilypond-user
[Top][All Lists]
Advanced

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

Re: Problem with Tags


From: David Kastrup
Subject: Re: Problem with Tags
Date: Sun, 13 Nov 2011 18:56:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Patrick Karl <address@hidden> 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




reply via email to

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