lilypond-user
[Top][All Lists]
Advanced

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

Re: Understanding how \tag works in \relative pitched music


From: Thomas Morley
Subject: Re: Understanding how \tag works in \relative pitched music
Date: Sat, 5 Aug 2017 10:32:33 +0200

2017-08-05 6:51 GMT+02:00 Guy Stalnaker <address@hidden>:
> So it's an Order of Operations issue. Pitches entered using \relative are
> first converted to absolute then the selection using \tag conditional.
>
> Which suggests that \tag used with \relative will never work.
>
> Thanks.
>
> On Aug 4, 2017 10:45 PM, "David Wright" <address@hidden> wrote:
>>
>> On Fri 04 Aug 2017 at 15:41:34 (-0500), Guy Stalnaker wrote:
>> > All,
>> >
>> > Why is this output being created? I would expect to get exactly the same
>> > pitches on all three staffs, but since not, my expectations are
>> > obviously
>> > wrong.
>> >
>> > %% SNIPPET %%
>> > straightMusic = \relative c' {
>> >   a2 _\markup { no tag, relative pitch } cis4 e |
>> >   fis1 |
>> > }
>> >
>> > clarinetOneMusic = \relative c' {
>> >   \set Score.markFormatter = #format-mark-box-numbers
>> >   \tag #'mark { \mark \default a2 _\markup { tag mark, relative pitch }
>> > cis4 e | }
>> >   \tag #'no-mark { a2 _\markup { tag no-mark, relative pitch } cis4 e |
>> > }
>> >   fis1 |
>> > }
>>
>> Here are the pitches you have entered:
>>
>> straightMusic = \relative c' { a2 cis4 e fis1 }
>>
>> clarinetOneMusic = \relative c' { a2 cis4 e a2 cis4 e fis1 }
>>
>> These pitches are interpreted during _input_ of the source and
>> become absolute pitches as they are read. They are now absolute
>> and stay that way.
>>
>> You have then selected a different set of notes (each with an absolute
>> pitch) for each staff by using tags, and then transposed them.
>>
>> In other words, \relative { … } is a one-shot, immediate input process
>> for making melodic input more convenient (for those of us who like it).
>>
>> Bear in mind that if \relative { … } contains notes that are already
>> absolute, eg,
>> \relative { … \absolute { A } … \transpose { T } … \relative { R } … }
>> the outer \relative does not reprocess A, T and R because they're
>> already absolute. (R is processed by the inner \relative first.)
>> Only the "…" notes are processed by the outer \relative.
>>
>> Cheers,
>> David.



In NR 3.3.2 Different editions from one source - Using Tags - Known
issues and warnings
http://lilypond.org/doc/v2.19/Documentation/notation/different-editions-from-one-source#using-tags

"Calling \relative on a music expression obtained by filtering music
through \keepWithTag or \removeWithTag might cause the octave
relations to change, as only the pitches actually remaining in the
filtered expression will be considered. Applying \relative first,
before \keepWithTag or \removeWithTag, avoids this danger as \relative
then acts on all the pitches as-input."

Following this advice leads to:

straightMusic = \relative c' {
  a2 cis4 e |
  fis1 |
}

clarinetOneMusic = \relative c' {
  \tag #'mark \relative c' { a2  cis4 e | }
  \tag #'no-mark \relative c' { a2  cis4 e | }
  fis1 |
}

\score {
  <<
    \new Staff {
      \transpose bes c' \straightMusic
    }
    \new Staff {
      \keepWithTag #'mark
      \transpose bes c' \clarinetOneMusic
    }
    \new Staff {
      \keepWithTag #'no-mark
      \transpose bes c' \clarinetOneMusic
    }
  >>
  \layout { }
}

Which is pretty much inline with what David W wrote.

Cheers,
  Harm



reply via email to

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