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: David Kastrup
Subject: Re: Combining \tag with \quoteDuring does not work
Date: Mon, 27 Mar 2017 18:53:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

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.

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?
             
-- 
David Kastrup



reply via email to

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