lilypond-user
[Top][All Lists]
Advanced

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

Re: Combining \tag with \quoteDuring does not work


From: Kaj Persson
Subject: Re: Combining \tag with \quoteDuring does not work
Date: Mon, 27 Mar 2017 19:26:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.3.0



Den 2017-03-27 kl. 18:53, skrev David Kastrup:
Kaj Persson <address@hidden> writes:

On 2017-03-27 at. 17:54, David Kastrup wrote:
Kaj Persson <address@hidden> writes:

Oh sorry, this was not according to my intention. And yet I embraced
the code with the HTML tags <code> ... </code>, a methode I have been
using several times before, with good results. Well I take your words
Some of them at least.  I did write an answer.

and send this e-mail again as pure text, which means I cannot paste
the images, why I instead attach them as files. Sorry for the mistake.

Here is the code:

\version "2.18.2"

Ma = \relative g' { c4 c c }
Mb = \relative g' { b4 b b }
Mc = \relative g' { a4 a a a a a \bar "||" }
Md = \relative g' { g4 g g }

Mj = { \Ma \Mb \Mc \tag #'X \Mb \Md }

Mk = \relative g' {
     \quoteDuring "Q" { s1*4*3/4 }
     \tag #'X { \quoteDuring "Q" { s4*3 } }
     \quoteDuring "Q" { s4*3 }
}
That likely doesn't do what you think it does.  If you remove the tagged
expression, what remains will be

Mk = \relative g' {
     \quoteDuring "Q" { s1*4*3/4 }
     \quoteDuring "Q" { s4*3 }
}
This is exactly what I want, but my impression is that I get this:

Mk = \relative g' {
    \quoteDuring "Q" { s1*4*3/4 }
    \quoteDuring "Q" { s4*3 } }
    \quoteDuring "Q" { s4*3 }
}

It just ignores and removes the "\tag #'X {".

My intention is that Mk shall follow Mj, and when the \removewithtag
#'X is active the Mb shall be excluded (the second time) in Mj as well
as in Mk. In Mj this works very well, but Mk ignores the tag and
continues with Mb after Mc.
You know what you actually quote following this?  The following:

instead of

Mk = \relative g' {
     \quoteDuring "Q" { s1*4*3/4 }
     s4*3
     \quoteDuring "Q" { s4*3 }
}

So what gets removed is the _end_ of the quoted expression rather than
the middle.

\addQuote "Q" { \Ma \Mb \Mc \tag #'X \Mb \Md }
The tag here is ineffective since it is inside of the quote.
I really recommend that you try reading _all_ of my commentary and
understanding it.

This is getting tiresome.  In particular since your "minimal example" is
rather convoluted and does lots of cross-referencing, making it
impossible to follow it.

But let's get through the bulk of it in small parts since there seems no
way to make you apply my comments to your code yourself.

First the definitions:

\version "2.18.2"

Ma = \relative g' { c4 c c }
Mb = \relative g' { b4 b b }
Mc = \relative g' { a4 a a a a a \bar "||" }
Md = \relative g' { g4 g g }

Mj = { \Ma \Mb \Mc \tag #'X \Mb \Md }

Mk = \relative g' {
    \quoteDuring "Q" { s1*4*3/4 }
    \tag #'X { \quoteDuring "Q" { s4*3 } }
    \quoteDuring "Q" { s4*3 }
}

As stated, removing the middle of Mk will result in the equivalent of

Mk = { \quoteDuring "Q" { s1*4*3/4 s4*3 } }

\addQuote "Q" { \Ma \Mb \Mc \tag #'X \Mb \Md }

is equivalent to

\addQuote "Q" { \Ma \Mb \Mc \Mb \Md }

since the tag isn't relevant for quoting.
Yes, this is the explanation! I thought that it takes the source as it is after change because of tags, but if it does not (as you say) my observations are exactly what you describe.

Then you have

S = {
    s1*3/4
    \mark \markup { \musicglyph #'"scripts.segno" } s4*3
    \mark \markup { \musicglyph #'"scripts.coda" }
    s2. s4 \mark \markup \line { "D.S. al" \raise #0.9 \musicglyph
#'"scripts.coda" } s2
    \tag #'X { s4*3 } \break
    \mark \markup { \musicglyph #'"scripts.coda" }
}

Where removing the tagged code will result in

S = {
    s1*3/4
    \mark \markup { \musicglyph #'"scripts.segno" } s4*3
    \mark \markup { \musicglyph #'"scripts.coda" }
    s2. s4 \mark \markup \line { "D.S. al" \raise #0.9 \musicglyph
#'"scripts.coda" } s2
    \break
    \mark \markup { \musicglyph #'"scripts.coda" }
}

and G = { \time 3/4 } (is there any reason you seem to want to obfuscate
your example as much as possible with trivial music expressions?)

So we get

\score {
   \removeWithTag #'X  % already executed everywhere
   {
     <<
       \new Staff {
         \time 3/4
         <<
            \new Voice {
                s1*3/4
                \mark \markup { \musicglyph #'"scripts.segno" } s4*3
                \mark \markup { \musicglyph #'"scripts.coda" }
                s2. s4 \mark \markup \line { "D.S. al" \raise #0.9 \musicglyph
             #'"scripts.coda" } s2
                \break
                \mark \markup { \musicglyph #'"scripts.coda" }
            }
            \new Voice {
              \voiceOne
              \Ma \Mb \Mc \Md
            }
         >>
       }
       \new Staff {
         \time 3/4
         \new Voice { \voiceTwo
           { \quoteDuring "Q" { s1*4*3/4 s4*3 } }
           % Q is \Ma \Mb \Mc \Mb \Md
           % and the quoted parts are 5 bars of 3/4 each, namely
           % \Ma \Mb \Mc \Mb
         }
       }
    >>
   }
}

So the result you show printed is _exactly_ the result according to my
explanation, yet you say it isn't, possibly because of glossing over
half of the explanation, possibly because of misunderstanding some part
of the explanation.

Which is it?
You gave the explaination above at "since the tag isn't relevant for quoting." I thought, that tags always change the source, but obviously I was wrong.

I agree, that my example is a wee to big and too scattered, which I also did comment in my first post. Instead of putting the marks in an own voice I could have included them in the code itself. I thought I made it more clear, but maybe I was wrong. The same with the \G which now just includes the \time command, but another time perhaps will contain more of common definitions. Maybe I should also have given them more descriptive names. I will think of that another time.

Thank you for help which got me understand why my observations did not agree with what I thought they should be.

/Kaj



reply via email to

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