Understanding how \tag works in \relative pitched music

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Understanding how \tag works in \relative pitched music

Guy Stalnaker-2
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 |
}

\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 { }
}
%% SNIPPET %%​

Inline image 1


Guy Stalnaker
[hidden email]

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Martin Neubauer
Maybe someone more well-versed with the inner workings of lilypond might
correct me here, but as I understand it, the pitches depend on the
sequence of notes in the input, regardless of any tags that might be
attached to some of them. Conversely, when \keepWithTag (or any of the
related commands) get evaluated, the pitches are already fixed.

On 04/08/2017 22:41, 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 |
> }
Not tested, but this might achieve what you want, while being somewhat
more predictable:

clarinetOneMusic = \relative c' {
  \set Score.markFormatter = #format-mark-box-numbers
  \tag #'mark { \mark \default <> _\markup { tag mark, relative pitch }}
  \tag #'no-mark { <> _\markup { tag no-mark, relative pitch } }
  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 { }
> }
> %% SNIPPET %%​
>
> ​Inline image 1​
>
>
> Guy Stalnaker
> [hidden email] <mailto:[hidden email]>
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
--
Good People Wanted and Managers too!


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

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

David Wright
In reply to this post by Guy Stalnaker-2
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.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Guy Stalnaker-2
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" <[hidden email]> 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.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Thomas Morley-2
2017-08-05 6:51 GMT+02:00 Guy Stalnaker <[hidden email]>:

> 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" <[hidden email]> 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

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Kieren MacMillan
In reply to this post by Guy Stalnaker-2
Hi Guy,

> Which suggests that \tag used with \relative will never work.

Whether or not your conclusion is technically accurate — others will be more qualified to confirm or correct — the unpredictability of \relative with \tag (which I used to use heavily, before finding the edition-engraver) was one of the principal reasons I abandoned the use of \relative in all my music some years ago, after almost a decade of using it exclusively. There are many, many other reasons I'm glad I switched to absolute (and \fixed), but this was a main one.

You might consider doing the same? Editors like Frescobaldi make it easy to switch code back and forth between relative and absolute — even so, I've never found a reason to go back to relative once I've converted any [legacy] code to absolute. (On rare occasions, I'll use \fixed.). I can say with great confidence that a measurable chunk of my frustration with Lilypond disappeared along with \relative.

Cheers,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

caagr98
Huh, can't say I've heard of \fixed. I always use \transpose c c'',
which seems to have the same effect. It looks stupid in the code, though.

And yeah, absolute mode is a lot easier than relative. If I want to
duplicate a measure, I prefer just duplicating it instead of having to
adjust the octave.

On 08/05/17 14:02, Kieren MacMillan wrote:

> Hi Guy,
>
>> Which suggests that \tag used with \relative will never work.
>
> Whether or not your conclusion is technically accurate — others will be more qualified to confirm or correct — the unpredictability of \relative with \tag (which I used to use heavily, before finding the edition-engraver) was one of the principal reasons I abandoned the use of \relative in all my music some years ago, after almost a decade of using it exclusively. There are many, many other reasons I'm glad I switched to absolute (and \fixed), but this was a main one.
>
> You might consider doing the same? Editors like Frescobaldi make it easy to switch code back and forth between relative and absolute — even so, I've never found a reason to go back to relative once I've converted any [legacy] code to absolute. (On rare occasions, I'll use \fixed.). I can say with great confidence that a measurable chunk of my frustration with Lilypond disappeared along with \relative.
>
> Cheers,
> Kieren.
> ________________________________
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: [hidden email]
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Kieren MacMillan
Hi,

> Huh, can't say I've heard of \fixed.

It may have been a relatively [ha!] recent addition…?
See <http://lilypond.org/doc/v2.19/Documentation/learning/absolute-note-names>

> I always use \transpose c c'', which seems to have the same effect. It looks stupid in the code, though.

A quick find-and-replace should solve that.  =)

> And yeah, absolute mode is a lot easier than relative. If I want to duplicate a measure, I prefer just duplicating it instead of having to adjust the octave.

Agreed. And including variables in multiple scores is immediate, etc.

Cheers,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

David Wright
In reply to this post by Guy Stalnaker-2
On Fri 04 Aug 2017 at 23:51:49 (-0500), Guy Stalnaker wrote:
> So it's an Order of Operations issue.

Unfortunately, your capitalisation indicates you haven't really
understood the implications of what I wrote.

> Pitches entered using \relative are
> first converted to absolute then the selection using \tag conditional.

But the conversion is effectively a lexical one, and is demonstrated
by the attached which is your example in absolute notation. If the
"\absolute evangelists" were to persuade the maintainers to abolish
\relative, a text editor could be persuaded to do the job. As things
are,   $ ly "rel2abs" -o abs.ly rel.ly
does the job.

> Which suggests that \tag used with \relative will never work.

They both work perfectly. The problem is that you thought you
could use \relative to do something semantic. There's a cure.
-When you use \relative, look at the pitches only, and treat the
source in strict lexical order in a single pass.
-When you are designing your \tag structure, imagine that all the
"\relative [optional-pitch]" occurrences have evaporated, leaving
behind just their { } and << >> constructs.

You know, sometimes I think it might have been wiser to go the
whole hog and treat relative/absolute/fixed in the same way
as \language is. The only thing I can see that you lose is their
ability to be nested. I wonder how many people rely on that.

> On Aug 4, 2017 10:45 PM, "David Wright" <[hidden email]> 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.

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

op-abs.ly (647 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Guy Stalnaker-2
My thanks to all who responded. There were three suggestions offered to "fix" my incorrect code and I confirm that all three produce the expected output.

Guy

On 8/5/2017 10:40 AM, David Wright wrote:
On Fri 04 Aug 2017 at 23:51:49 (-0500), Guy Stalnaker wrote:
So it's an Order of Operations issue.
Unfortunately, your capitalisation indicates you haven't really
understood the implications of what I wrote.

Pitches entered using \relative are
first converted to absolute then the selection using \tag conditional.
But the conversion is effectively a lexical one, and is demonstrated
by the attached which is your example in absolute notation. If the
"\absolute evangelists" were to persuade the maintainers to abolish
\relative, a text editor could be persuaded to do the job. As things
are,   $ ly "rel2abs" -o abs.ly rel.ly
does the job.

Which suggests that \tag used with \relative will never work.
They both work perfectly. The problem is that you thought you
could use \relative to do something semantic. There's a cure.
-When you use \relative, look at the pitches only, and treat the
source in strict lexical order in a single pass.
-When you are designing your \tag structure, imagine that all the
"\relative [optional-pitch]" occurrences have evaporated, leaving
behind just their { } and << >> constructs.

You know, sometimes I think it might have been wiser to go the
whole hog and treat relative/absolute/fixed in the same way
as \language is. The only thing I can see that you lose is their
ability to be nested. I wonder how many people rely on that.

On Aug 4, 2017 10:45 PM, "David Wright" [hidden email] 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.

-- 
“Happiness is the meaning and the purpose of life, the whole aim and end of human existence.”
― Aristotle

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
dak
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

dak
In reply to this post by caagr98
[hidden email] writes:

> Huh, can't say I've heard of \fixed. I always use \transpose c c'',
> which seems to have the same effect. It looks stupid in the code,
> though.

The effect is not the same.

\transpose c c'' \absolute ...

is the same as

\transpose c c'' ...

while

\fixed c'' \absolute ...

is the same as

\transpose c c ...

since \fixed, like \relative and \absolute, does not affect music that
has already been turned into absolute in some manner.

This may be quite relevant when working with music variables.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

David Wright
In reply to this post by Kieren MacMillan
On Sat 05 Aug 2017 at 09:07:48 (-0400), Kieren MacMillan wrote:
> Hi,
>
> > Huh, can't say I've heard of \fixed.
>
> It may have been a relatively [ha!] recent addition…?
> See <http://lilypond.org/doc/v2.19/Documentation/learning/absolute-note-names>

AFAICT \fixed is not in 2.18.2 but is in 2.19 versions and their NMs.
However, its only appearance in Changes (New Features) seems to be its
use without introduction on the first page.

> > And yeah, absolute mode is a lot easier than relative. If I want to duplicate a measure, I prefer just duplicating it instead of having to adjust the octave.
>
> Agreed. And including variables in multiple scores is immediate, etc.

Well, it doesn't surprise me that you, as a composer, are happier
using \absolute. The situation is quite different for transcribers
of melodic music. The only places where \absolute is useful to me
is with fragmentary parts, generally in the odd keyboard transriptions
or reductions forced on me. (I didn't quite understand your use
of "immediate" above.)

\fixed makes me realise why, as a singer, both \fixed and \absolute
don't fit with my way of thinking about pitch: they are both
"octave-centric". IOW they treat the pitch change from b to c' (in
all octaves) as special, whereas to me they're just two notes that
happen to be next to each other, like e and f. Whether this is also
influenced by possession of perfect pitch (which I don't have), I
don't know.

(\fixed could have been implemented differently, ie without
collapsing the meaning of c' through b' as its first argument.
This might make it more useful for parts having a limited range
centered close to c.)

Anyway, would the people who like \absolute please be a little less
evangelical about it. Some of us are happy using \relative, and
understand how it interacts (or, more usually, doesn't) with other
constructions in LP. It's odd that one of your main reasons for
abandoning \relative was merely a misunderstanding of what it
does, but I think that that could partly be blamed on its
documentation. \relative's treatment of accidentals merits bold
typeface in the LM; perhaps its existence as an immediate _input_
method could be similarly emphasised where appropriate.

Cheers,
David.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
dak
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

dak
David Wright <[hidden email]> writes:

> (\fixed could have been implemented differently, ie without
> collapsing the meaning of c' through b' as its first argument.
> This might make it more useful for parts having a limited range
> centered close to c.)

How so?  The reason we collapsed the meaning is that we had several
different opinions of what the natural behavior of \fixed f' should be
"obviously", so we punted by choosing behavior that did not provide
(possibly shortlived) usefulness for anything rather than c'''.

> Anyway, would the people who like \absolute please be a little less
> evangelical about it.

Uh, where is the point?  This is a discussion group.

> Some of us are happy using \relative, and understand how it interacts
> (or, more usually, doesn't) with other constructions in LP. It's odd
> that one of your main reasons for abandoning \relative was merely a
> misunderstanding of what it does, but I think that that could partly
> be blamed on its documentation. \relative's treatment of accidentals
> merits bold typeface in the LM; perhaps its existence as an immediate
> _input_ method could be similarly emphasised where appropriate.

\relative is a tool for expressing input.  As such, it should offer
significant clarity with regard to one aspect of input.  It doesn't do
that impressively when communicating with other programs, so its main
incentive is communication with humans.  When humans are confused about
what it does, it fails on one of the core tenets of its justification.

So its advantages are not without drawbacks, and people weighing in on
how those affect them respectively are making for a clearer picture.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

David Wright
On Sun 06 Aug 2017 at 22:51:57 (+0200), David Kastrup wrote:

> David Wright <[hidden email]> writes:
>
> > (\fixed could have been implemented differently, ie without
> > collapsing the meaning of c' through b' as its first argument.
> > This might make it more useful for parts having a limited range
> > centered close to c.)
>
> How so?  The reason we collapsed the meaning is that we had several
> different opinions of what the natural behavior of \fixed f' should be
> "obviously", so we punted by choosing behavior that did not provide
> (possibly shortlived) usefulness for anything rather than c'''.

As an example, some hymn tunes have alto parts of very limited range,
barely a few notes. However, those notes frequently lie around middle C
which means that both \fixed c and \fixed c' will have many octavation
marks, either "'" or ",". However, were \fixed g { … } to mean that
unmarked notes lie in the absolute range g through f', the number of
marks required would be drastically reduced, which is how I was measuring
usefulness. (I have no idea whether this methodology was one of the
"obvious natural behaviours" that were considered and passed over.)

> > Anyway, would the people who like \absolute please be a little less
> > evangelical about it.
>
> Uh, where is the point?  This is a discussion group.

Yes, but there seem to be occasional postings where the opinions
come across as attempts at conversion rather than mere discussion. I
didn't want to be specific, but perhaps it's necessary for you—eg,
"There are many, many other reasons I'm glad I switched to absolute
(and \fixed), but this was a main one. You might consider doing the same?"

> > Some of us are happy using \relative, and understand how it interacts
> > (or, more usually, doesn't) with other constructions in LP. It's odd
> > that one of your main reasons for abandoning \relative was merely a
> > misunderstanding of what it does, but I think that that could partly
> > be blamed on its documentation. \relative's treatment of accidentals
> > merits bold typeface in the LM; perhaps its existence as an immediate
> > _input_ method could be similarly emphasised where appropriate.
>
> \relative is a tool for expressing input.  As such, it should offer
> significant clarity with regard to one aspect of input.

And it succeeds in at least two for me. I've already mentioned one,
the treatment of intervals across b-c. Another is preventing LP code
looking like fly-shit language (cf Leaning Toothpick Syndrome).

> It doesn't do
> that impressively when communicating with other programs, so its main
> incentive is communication with humans.  When humans are confused about
> what it does, it fails on one of the core tenets of its justification.

That argument fails because not all humans are the same. The humans
that are confused are those that don't seem to learn/understand/
retain your sentence "\relative is a tool for expressing input."

> So its advantages are not without drawbacks, and people weighing in on
> how those affect them respectively are making for a clearer picture.

I'd be interested to know whether you agree with "the unpredictability
of \relative with \tag". I don't see it (as I expressed earlier), but
would value your opinion as you've probably forgotten more about LP
than I ever knew.

Cheers,
David.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
dak
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

dak
David Wright <[hidden email]> writes:

> On Sun 06 Aug 2017 at 22:51:57 (+0200), David Kastrup wrote:
>> David Wright <[hidden email]> writes:
>>
>> > (\fixed could have been implemented differently, ie without
>> > collapsing the meaning of c' through b' as its first argument.
>> > This might make it more useful for parts having a limited range
>> > centered close to c.)
>>
>> How so?  The reason we collapsed the meaning is that we had several
>> different opinions of what the natural behavior of \fixed f' should be
>> "obviously", so we punted by choosing behavior that did not provide
>> (possibly shortlived) usefulness for anything rather than c'''.
>
> As an example, some hymn tunes have alto parts of very limited range,
> barely a few notes. However, those notes frequently lie around middle C
> which means that both \fixed c and \fixed c' will have many octavation
> marks, either "'" or ",". However, were \fixed g { … } to mean that
> unmarked notes lie in the absolute range g through f', the number of
> marks required would be drastically reduced, which is how I was measuring
> usefulness. (I have no idea whether this methodology was one of the
> "obvious natural behaviours" that were considered and passed over.)

So what does \fixed fes' do to { disis e eis feses fes f } ?  What is
its natural interpretation?

>> > Anyway, would the people who like \absolute please be a little less
>> > evangelical about it.
>>
>> Uh, where is the point?  This is a discussion group.
>
> Yes, but there seem to be occasional postings where the opinions come
> across as attempts at conversion rather than mere discussion.

So?  When people have problems with a particular construct that is
working as designed (we are not talking about shortcomings in the
implementation here) and alternative designs have proven better for
them, I see nothing wrong with reporting this.

It is true that there is a whole lot of repetition going on in this
mailng list that may be tiring to seasoned readers but may be due to the
same question coming up again and again and people not resolving it by
exhaustively searching the archives.  But that's also in the nature of a
list.

> I didn't want to be specific, but perhaps it's necessary for you—eg,
> "There are many, many other reasons I'm glad I switched to absolute
> (and \fixed), but this was a main one. You might consider doing the
> same?"

"you might consider" and "you should" are two different things, and it's
not like the list did not leave the questioner also with a fine-grained
explanation of what happens exactly when you use \relative.  So he has
all the necessary information for considering and/or trying and/or
rejecting such a switch.

>> > Some of us are happy using \relative, and understand how it
>> > interacts (or, more usually, doesn't) with other constructions in
>> > LP. It's odd that one of your main reasons for abandoning \relative
>> > was merely a misunderstanding of what it does, but I think that
>> > that could partly be blamed on its documentation. \relative's
>> > treatment of accidentals merits bold typeface in the LM; perhaps
>> > its existence as an immediate _input_ method could be similarly
>> > emphasised where appropriate.
>>
>> \relative is a tool for expressing input.  As such, it should offer
>> significant clarity with regard to one aspect of input.
>
> And it succeeds in at least two for me. I've already mentioned one,
> the treatment of intervals across b-c. Another is preventing LP code
> looking like fly-shit language (cf Leaning Toothpick Syndrome).

\fixed is also pretty good at minimizing fly-shit.  It becomes worse in
that regard for stuff with widely navigated ranges, but that's exactly
where \relative becomes markedly harder to write and read correctly.

>> It doesn't do that impressively when communicating with other
>> programs, so its main incentive is communication with humans.  When
>> humans are confused about what it does, it fails on one of the core
>> tenets of its justification.
>
> That argument fails because not all humans are the same. The humans
> that are confused are those that don't seem to learn/understand/
> retain your sentence "\relative is a tool for expressing input."

Well, we can't tell them to drop dead, can we?  So both telling them
what \relative does and what alternatives are there seems like a
reasonable approach to me.

>> So its advantages are not without drawbacks, and people weighing in
>> on how those affect them respectively are making for a clearer
>> picture.
>
> I'd be interested to know whether you agree with "the unpredictability
> of \relative with \tag". I don't see it (as I expressed earlier), but
> would value your opinion as you've probably forgotten more about LP
> than I ever knew.

For me it's not "unpredictable" as I'm rather acquainted with its
internals and mechanism.  But that doesn't mean that I don't find it
"getting in the way" of usefully expressing things.

I explicitly designed the "make-relative" macro to make it easier for
people using music functions to let them behave reasonably naturally.
See

http://lilypond.org/doc/v2.19/input/regression/collated-files.html#make-relative.ly

for an example (click on the make-relative.ly link to see the source
code): the \relative version is easier to input and definitely reduces
"flyshit".  Without using make-relative, this would be completely
unusable in behavior.

Now make-relative is a convenient but quite heavy-handed macro.  There
are situations where it fails, and then it does so spectacularly.

The reason is that it allows creating a more natural "user experience"
by a totally unnatural and complex actual inner operation that has to be
defined individually for each music function written by the programmer.

This is a tradeoff, and one side of the tradeoff is definitely more
likely to strand users with question marks on their face on the lists.
Of course, if the alternative is to strand them with disgust on their
face with software not having a text input language at all, that's not
much of an improvement.

Now as people tend to work more and more with LilyPond, they tend to
become bit by bit more of a programmer rather than a mere user, work
less by trial and error, and cover more complex input sources with
multiple voices.  As they do, dealing with the complexities of \relative
and the resulting ripple effects of local source modifications and
reorganizations become more of a nuisance and one becomes more aware of
the _cost_ of fly-speck cleaning.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

David Wright
On Mon 07 Aug 2017 at 08:43:31 (+0200), David Kastrup wrote:

> David Wright <[hidden email]> writes:
>
> > On Sun 06 Aug 2017 at 22:51:57 (+0200), David Kastrup wrote:
> >> David Wright <[hidden email]> writes:
> >>
> >> > (\fixed could have been implemented differently, ie without
> >> > collapsing the meaning of c' through b' as its first argument.
> >> > This might make it more useful for parts having a limited range
> >> > centered close to c.)
> >>
> >> How so?  The reason we collapsed the meaning is that we had several
> >> different opinions of what the natural behavior of \fixed f' should be
> >> "obviously", so we punted by choosing behavior that did not provide
> >> (possibly shortlived) usefulness for anything rather than c'''.
> >
> > As an example, some hymn tunes have alto parts of very limited range,
> > barely a few notes. However, those notes frequently lie around middle C
> > which means that both \fixed c and \fixed c' will have many octavation
> > marks, either "'" or ",". However, were \fixed g { … } to mean that
> > unmarked notes lie in the absolute range g through f', the number of
> > marks required would be drastically reduced, which is how I was measuring
> > usefulness. (I have no idea whether this methodology was one of the
> > "obvious natural behaviours" that were considered and passed over.)
>
> So what does \fixed fes' do to { disis e eis feses fes f } ?  What is
> its natural interpretation?

Were I to be deciding that, I would cut and paste this paragraph from
the LM and adjust the wording:
"Exactly the same happens even when any of these notes are sharpened or flattened. Acci-
dentals are totally ignored in the calculation of relative position. Precisely the same staff space
counting is done from a note at any other position on the staff."

So it would use the unmodified note names just as \relative and the
current implementation of \fixed do. As things are, \fixed effectively
throws away the note name of the reference pitch as well as
accidentals. The syntax could have been \fixed , { … } \fixed { … } \fixed ' { … }
with a "c" merely implied, because all it does is add the requisite
amount of poop and cancel out any contradictions.

> >> > Anyway, would the people who like \absolute please be a little less
> >> > evangelical about it.
> >>
> >> Uh, where is the point?  This is a discussion group.
> >
> > Yes, but there seem to be occasional postings where the opinions come
> > across as attempts at conversion rather than mere discussion.
>
> So?  When people have problems with a particular construct that is
> working as designed (we are not talking about shortcomings in the
> implementation here) and alternative designs have proven better for
> them, I see nothing wrong with reporting this.

Neither do I. But the post I was commenting on was constructing an
Aunt Sally argument, "the unpredictability of \relative with \tag"
as a reason to make the change.

> It is true that there is a whole lot of repetition going on in this
> mailng list that may be tiring to seasoned readers but may be due to the
> same question coming up again and again and people not resolving it by
> exhaustively searching the archives.  But that's also in the nature of a
> list.

Guilty as charged.

> > I didn't want to be specific, but perhaps it's necessary for you—eg,
> > "There are many, many other reasons I'm glad I switched to absolute
> > (and \fixed), but this was a main one. You might consider doing the
> > same?"
>
> "you might consider" and "you should" are two different things, and it's
> not like the list did not leave the questioner also with a fine-grained
> explanation of what happens exactly when you use \relative.

Well, that's what I tried to do by removing the parts of the code
that had no bearing on \relative's behaviour but (a) were obscuring
the simple relation of the note pitches being input and (b) were
believed erroneously by the OP to have some influence on the pitches
of those notes.

> So he has
> all the necessary information for considering and/or trying and/or
> rejecting such a switch.

Oh come on. There are contributors here whose words carry far more
weight than many of us, and with good reason. Their posts get pasted
into archives and consulted later, so their accuracy is all the more
important.

> >> > Some of us are happy using \relative, and understand how it
> >> > interacts (or, more usually, doesn't) with other constructions in
> >> > LP. It's odd that one of your main reasons for abandoning \relative
> >> > was merely a misunderstanding of what it does, but I think that
> >> > that could partly be blamed on its documentation. \relative's
> >> > treatment of accidentals merits bold typeface in the LM; perhaps
> >> > its existence as an immediate _input_ method could be similarly
> >> > emphasised where appropriate.
> >>
> >> \relative is a tool for expressing input.  As such, it should offer
> >> significant clarity with regard to one aspect of input.
> >
> > And it succeeds in at least two for me. I've already mentioned one,
> > the treatment of intervals across b-c. Another is preventing LP code
> > looking like fly-shit language (cf Leaning Toothpick Syndrome).
>
> \fixed is also pretty good at minimizing fly-shit.  It becomes worse in
> that regard for stuff with widely navigated ranges,

Agreed. And I was just expressing how it might have been better,
in my opinion. As it is, I gain nothing over \relative so I
haven't used it.

> but that's exactly
> where \relative becomes markedly harder to write and read correctly.

Yes, but as a singer transcribing music, I can hum ahead and mentally
grok large intervals more easily than having to deal with octavation
every time I step over the b-c divide. This divide is firmly embedded
in music notation but not in the musical part of my brain.

But I'm not trying to dissuade anyone from using \absolute and, now,
\fixed. In fact, I was contradicted when I expressed an opinion that
it would be difficult to _compose_ directly into anything other than
\absolute because of all the cutting and pasting involved.

> >> It doesn't do that impressively when communicating with other
> >> programs, so its main incentive is communication with humans.  When
> >> humans are confused about what it does, it fails on one of the core
> >> tenets of its justification.
> >
> > That argument fails because not all humans are the same. The humans
> > that are confused are those that don't seem to learn/understand/
> > retain your sentence "\relative is a tool for expressing input."
>
> Well, we can't tell them to drop dead, can we?

I didn't say that. I said that you haven't shown it fails on one of
the core tenets of its justification merely because some humans have
difficulty learning/understanding/retaining the concept.

> So both telling them
> what \relative does and what alternatives are there seems like a
> reasonable approach to me.

Yes, but why cloud the issue with alternative facts about unpredictability?

> >> So its advantages are not without drawbacks, and people weighing in
> >> on how those affect them respectively are making for a clearer
> >> picture.
> >
> > I'd be interested to know whether you agree with "the unpredictability
> > of \relative with \tag". I don't see it (as I expressed earlier), but
> > would value your opinion as you've probably forgotten more about LP
> > than I ever knew.
>
> For me it's not "unpredictable" as I'm rather acquainted with its
> internals and mechanism.  But that doesn't mean that I don't find it
> "getting in the way" of usefully expressing things.
>
> I explicitly designed the "make-relative" macro to make it easier for
> people using music functions to let them behave reasonably naturally.
> See
>
> http://lilypond.org/doc/v2.19/input/regression/collated-files.html#make-relative.ly
>
> for an example (click on the make-relative.ly link to see the source
> code): the \relative version is easier to input and definitely reduces
> "flyshit".  Without using make-relative, this would be completely
> unusable in behavior.
>
> Now make-relative is a convenient but quite heavy-handed macro.  There
> are situations where it fails, and then it does so spectacularly.
>
> The reason is that it allows creating a more natural "user experience"
> by a totally unnatural and complex actual inner operation that has to be
> defined individually for each music function written by the programmer.

Hey, programming's hard. Glad I'm retired.

One way of reducing complexity for the users is to try and keep things
orthogonal, so that doing one thing doesn't lead to a side-effect
elsewhere. So if you believe a side-effect exists and try to exploit
it (like here where the OP thought that \tag could turn \relative
on and off), is it not best to disabuse the OP of the interaction
rather than leave them with, or even reinforce, the impression that
\tag is leading to unpredictability?

> This is a tradeoff, and one side of the tradeoff is definitely more
> likely to strand users with question marks on their face on the lists.
> Of course, if the alternative is to strand them with disgust on their
> face with software not having a text input language at all, that's not
> much of an improvement.
>
> Now as people tend to work more and more with LilyPond, they tend to
> become bit by bit more of a programmer rather than a mere user, work
> less by trial and error, and cover more complex input sources with
> multiple voices.  As they do, dealing with the complexities of \relative
> and the resulting ripple effects of local source modifications and
> reorganizations become more of a nuisance and one becomes more aware of
> the _cost_ of fly-speck cleaning.

So what you appear to be saying in these paragraphs is that \relative
doesn't play well with scheme programming. Two things occur to me:

LP should have a well-defined and predictable behaviour, and this
should be reflected in its documentation.

If one can't understand the definition, behaviour, upsides and
downsides of \relative, is there much hope of advancing into
scheme programming and how that interacts with LP?

Cheers,
David.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
dak
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

dak
David Wright <[hidden email]> writes:

> Neither do I. But the post I was commenting on was constructing an
> Aunt Sally argument, "the unpredictability of \relative with \tag"
> as a reason to make the change.

Maybe "unpredictability" was not the best expression.  It's clear that
Kieren was referring not to non-deterministic but surprising behavior.

The truth is that \relative does not interact with \tag at all.  But
that means that you get different results for

    \relative \keepWithTag ...

and

    \keepWithTag ... \relative

because then \relative gets to work with different material.

> Well, that's what I tried to do by removing the parts of the code
> that had no bearing on \relative's behaviour but (a) were obscuring
> the simple relation of the note pitches being input and (b) were
> believed erroneously by the OP to have some influence on the pitches
> of those notes.

At some point of time we have to acknowledge that people and humans are
wired differently.  The difference might not be all that large when
looking at me but then you would likely not want to reduce composers to
that kind of crop.  So it's important to be able to cater to people with
differing capability of in-depth understanding of mathematical and/or
programming logic.

>> So he has
>> all the necessary information for considering and/or trying and/or
>> rejecting such a switch.
>
> Oh come on. There are contributors here whose words carry far more
> weight than many of us, and with good reason. Their posts get pasted
> into archives and consulted later, so their accuracy is all the more
> important.

"Accuracy" is not the same as "agrees with David", actually for any
value of David.

>> \fixed is also pretty good at minimizing fly-shit.  It becomes worse
>> in that regard for stuff with widely navigated ranges,
>
> Agreed. And I was just expressing how it might have been better,
> in my opinion. As it is, I gain nothing over \relative so I
> haven't used it.

That's fine, and you are free to express this opinion just as Kieren is
free to express his.  And you have harped over it a lot longer than he
has.

> But I'm not trying to dissuade anyone from using \absolute and, now,
> \fixed. In fact, I was contradicted when I expressed an opinion that
> it would be difficult to _compose_ directly into anything other than
> \absolute because of all the cutting and pasting involved.

It's a contrarian list and it doesn't help that I am an active
participant.

>> >> It doesn't do that impressively when communicating with other
>> >> programs, so its main incentive is communication with humans.
>> >> When humans are confused about what it does, it fails on one of
>> >> the core tenets of its justification.
>> >
>> > That argument fails because not all humans are the same.

All humans are the same as themselves, and most LilyPond users are
themselves the most relevant human reader of the LilyPond source they
write.

Of course humans are capable of learning to navigate any amount of
complexity with enough determination, like they can learn to play bad
instruments well.  But if you find in the long run that fighting your
instrument is becoming a major drain of your focus and thus is taking
resources better invested elsewhere, improving or changing your
instrument might be smarter than trying to become smarter.

> I didn't say that. I said that you haven't shown it fails on one of
> the core tenets of its justification merely because some humans have
> difficulty learning/understanding/retaining the concept.

It fails for them.  Whether fixing that makes sense is up to them.

>> Now make-relative is a convenient but quite heavy-handed macro.
>> There are situations where it fails, and then it does so
>> spectacularly.
>>
>> The reason is that it allows creating a more natural "user
>> experience" by a totally unnatural and complex actual inner operation
>> that has to be defined individually for each music function written
>> by the programmer.
>
> Hey, programming's hard. Glad I'm retired.

It's not that programming is hard but that the concept of \relative does
not map well to music functions or other forms of rearranging input
since the user expectation with regard to \relative is focused on input
order rather than music expression internal order.

In fact, the mess \relative creates was such that issue 2240 (changing
the music expression internals, various followup issues) was necessary
for fixing chord repetition in \relative mode, in order to have issue
2263 for fixing the long-standing issue 1110.

Issue 2240 and all of the followup work took several months of work, and
\relative has intervened for additional work several times.  The "Hey,
programming is hard.  Glad I'm retired." attitude coupled with the
expectation that some sucker is going to do it because you won't is
actually pretty offensive considering on how little money I had and have
to get by for making such actually inherent problems mostly go away.
What kind of retirement entitles you to have me and other programmers
make LilyPond work according to your expectations?

> One way of reducing complexity for the users is to try and keep things
> orthogonal, so that doing one thing doesn't lead to a side-effect
> elsewhere. So if you believe a side-effect exists and try to exploit
> it (like here where the OP thought that \tag could turn \relative on
> and off), is it not best to disabuse the OP of the interaction rather
> than leave them with, or even reinforce, the impression that \tag is
> leading to unpredictability?

We have warnings in the manual exactly because users in general find the
interaction of \relative and the \tag-related commands surprising.  If
you lecture users on the same questions year after year after, at some
point you ask yourself where the point in being right is when it is so
much trouble.

>> Now as people tend to work more and more with LilyPond, they tend to
>> become bit by bit more of a programmer rather than a mere user, work
>> less by trial and error, and cover more complex input sources with
>> multiple voices.  As they do, dealing with the complexities of
>> \relative and the resulting ripple effects of local source
>> modifications and reorganizations become more of a nuisance and one
>> becomes more aware of the _cost_ of fly-speck cleaning.
>
> So what you appear to be saying in these paragraphs is that \relative
> doesn't play well with scheme programming.

It doesn't play well with logic.  It raises naive expectations that
don't map well to music structures.

> Two things occur to me:
>
> LP should have a well-defined and predictable behaviour, and this
> should be reflected in its documentation.
>
> If one can't understand the definition, behaviour, upsides and
> downsides of \relative, is there much hope of advancing into
> scheme programming and how that interacts with LP?

Issue 1110 was raised in 2010.  The first attempt of fixing the
interaction of chord repeats with \relative was

commit 811cdc2809ee224dfbe79576c4ac6e1fe9057db5
Author: Nicolas Sceaux <[hidden email]>
Date:   Thu Dec 3 11:44:10 2009 +0100

    Chord repetition: \relative mode, cautionary accidentals
   
    \relative mode: Introduce a new RepeatedChord music type, which element
    property is the copied chord (as produced by the chord repetition function).
    Define a relative callback for repeated chords, which avoids
    octaviation of repeated chords, by modifying the first note octave
    before applying the octave relativization.
   
    Only memorize <..> chords.
   
    When copying a chord, unset cautionary and forced accidental (fix #925).

It didn't work reliably.  \relative also has consequences in the
implementation of \repeat and its unfoldings.  Whenever a user does some
programming, chances are that the results will not operate as expected
within \relative.  Dozens of LSR examples were (and some likely still
are) affected.

Soa power user deciding to forego \relative is likely to make their life
easier.

\fixed is much less afflicted in that manner.  Yet.  It is somewhat
equivalent to \transpose (not entirely so since \fixed leaves \absolute
and \relative and other \fixed music alone while \transpose doesn't).

So

    \fixed c'' { c d e f g a b c' }

maps to

    \absolute { c'' d'' e'' f'' g'' a'' b'' c''' }

So what do you think

    \fixed a'' { c d e f g a b c' }

should map to?  Maybe

    \absolute { c' d' e' f' g' a'' b'' c'' }

?  So as the argument to \fixed rises, the result gets lower until the
octave jumps and then it gets higher?  That's sort-of discontinuous.
The continuous result would be

    \absolute { c'' d'' e''' f''' g''' a''' b''' c''' }

but you can't really make anybody cheer for that as a user interface
even though it would be logical.  So you are likely rooting for the
discontinuous approach.

Now \relative is implemented through relativization hooks: expressions
know themselves how they are supposed to deal with relativization.
Unfortunately this knowledge does not map to your \fixed scheme.  The
current definition of \fixed (hey, should use for-each instead of map)
is:

fixed =
#(define-music-function (pitch music)
   (ly:pitch? ly:music?)
   (_i "Use the octave of @var{pitch} as the default octave for @var{music}.")
   (let ((octave-marks (1+ (ly:pitch-octave pitch))))
     (cond ((not (= 0 octave-marks))
            (ly:music-transpose music (ly:make-pitch octave-marks 0 0))
            ;;In order to leave unchanged the notes in any enclosed
            ;; \absolute or \fixed or \relative, make a cancelling shift
            (map (lambda (m)
                   (ly:music-transpose m (ly:make-pitch (- octave-marks) 0 0)))
                 (extract-named-music music 'RelativeOctaveMusic)))))
   (make-music 'RelativeOctaveMusic 'element music))


Programming is hard.  Good that you are retired.

--
David Kastrup

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