lilypond-user
[Top][All Lists]
Advanced

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

Re: Proposed new available and recommended behavior of \relative


From: David Kastrup
Subject: Re: Proposed new available and recommended behavior of \relative
Date: Fri, 08 Mar 2013 06:29:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Graham Percival <address@hidden> writes:

> On Thu, Mar 07, 2013 at 08:06:24PM +0100, David Kastrup wrote:
>> 
>> The idea is that \relative { ... } (namely \relative used without an
>> explicit reference pitch) uses the first note inside as the reference
>> pitch.  That is, if the first note happens to be written as fis'' it
>> will sound as fis'' (absolute pitch).
>
> I don't like this, since it mixes the meanings of ' within a {}
> scope.  I mean, with that change and given the input:
>   \relative { c' c' }
> the first c' means "middle C"
> the second c' means "jump an octave higher"

Nobody keeps you from interpreting the first c' as "jump an octave
higher from c".

> Whereas keeping the explicit initial pitch:
>   \relative c' { c' c' }
> the c' outside the {} means "middle C"
> each c' inside the {} means "jump an octave higher"

Not every piece starts from c, and we had lots of discussions about what
to do when it doesn't.  I think we promoted using \relative x''' { x for
this case so that one would not have to figure out the relation of x to
c to figure out the starting pitch, and \relative x''' { x is really
not more helpful than \relative { x'''.

Here are some examples from our code
base:

\context Voice  \relative c'' {
  \time 2/4
  \tuplet 3/2 { r c,,, c''' }
  \tuplet 3/2 { r c c  }
  \tuplet 3/2 { r c r }
  [...]
}

\context Voice\relative c'' {
  \tuplet 3/2 { b'4 b b }
  \tuplet 3/2 { f4 f f }
  \tuplet 3/2 { g4 g g }
  \tuplet 3/2 { a4 a a }
}

vone =  \relative a' { d4 r8 d8 d8 r8 d8 r8 d2 ~ d2 ~ d4 }
vtwo =  \relative g' { g4.   g8 r2          g4 r4 r2  g4 } 

Then we have in our beginner section Documentation/learning/fundamental
things like

sopranoMusic = \relative c'' {
  \clef "treble"
  r4 d2 a4 | d4. d8 a2 | cis4 d cis2 |
}

altoMusic = \relative a' {
  \clef "treble"
  r4 a2 a4 | fis4. fis8 a2 | g4 fis e2 |
}

tenorMusic = \relative c' {
  \clef "G_8"
  r4 fis2 e4 | d4. d8 d2 | e4 a, cis2 |
}

bassMusic = \relative c' {
  \clef "bass"
  r4 d2 cis4 | b4. b8 fis2 | e4 d a'2 |
}

What's the deal with that?  How is this helpful when the starting pitch
is not specified in relation to a preceding pitch in a musical phrase
but rather in relation to some phantasmagoric pitch not in relation to
scale or melody?  There is no c' in the key signature, so why in the
\relative statements?

This passage becomes

sopranoMusic = \relative {
  \clef "treble"
  r4 d''2 a4 | d4. d8 a2 | cis4 d cis2 |
}

altoMusic = \relative {
  \clef "treble"
  r4 a'2 a4 | fis4. fis8 a2 | g4 fis e2 |
}

tenorMusic = \relative {
  \clef "G_8"
  r4 fis'2 e4 | d4. d8 d2 | e4 a, cis2 |
}

bassMusic = \relative {
  \clef "bass"
  r4 d'2 cis4 | b4. b8 fis2 | e4 d a'2 |
}

Which makes it actually possible to view the starting pitch in relation
with each other rather than an artificial pitch not connected to
anything.  Now of course, you can use absolute mode throughout if you
want to see the relations.  But the point is that with \relative x''',
the "relation" of the first pitch is to something not written in the
music.  It is arbitrary and without meaning.

> Is it really such a typing burden to add a c' between "relative"
> and "{" in order to make the file easier to read?

Do the above relative pitch specifications make the file easier to read?

> I know that David knows this, but just to remind people, you can
> absolutely do things like \relative a'' { a b } \relative f,, { f d }

And distribute the pitch information across two places possibly
separated like

\relative a' << \new Voice \time 2/4 \key g\major \clef "treble" R1*20
\tuplet 3/2 { r r r } \tuplet 3/2 { r as

> instead of using an octave of C for the initial pitch.

To avoid the spreadout of information, we promote starting each measure
in the manual with an explicit notelength.  Each measure.

Make no mistake: you are free to like or dislike this change, and if
enough people dislike it, it is dead.  We might or might not make the
actual change of semantics without anything else, just using the part of
the convert-ly rule that converts \relative ... into \relative c' ...,
which will change about a dozen places in our code base that have been
overlooked by our "\relative should have an explicit reference pitch"
policy.

As Keith said: the net effect will likely be five people annoyed and ten
people elated or the other way round.  Either way, it will be irrelevant
to pretty much everyone's workflows.  So it is not really the
interesting option.

With regard to the interesting option, namely connecting this change
with a proposed change in usage, there is personal like and dislike
(which is moderated by everybody retaining the option to choose his
individual way).  And there is the question about what will be easier in
the long run to work with and get to see for old and new users.

Of course your arguments are valid.  After all, they are a
rationalization of policies we have agreed on previously.  I just think
that you underestimate the improvement (which is one of degree rather
than a quantum leap) that can be made.

And make no mistake: our code base does not show _any_ coherent usage of
\relative.  Whatever policies we decided to make, we have not even put
them into place for learning/fundamental.  Putting a policy into place
means a definitely preferred option.  This one has the advantage of not
being arbitrary.

The "octave of c" rule gets ugly for things like
\relative c' { ces,
and the "octave of starting pitch" rule requires synchronizing with the
starting pitch and keeping track of when one edits it.

The drawback of the absolute pitch proposal basically is "the first note
tends to have more ''' and ,,, to it than following notes".  That's
indeed the case, and there is no \relative ''' { c e g } to make up for
it.  That's the price to pay.  Naturally, everybody is free to write
\relative c''' { c e g } after all, but if we do the full documentation
change, code you are likely to see from others and code you are writing
for the LilyPond manual will look like \relative { c''' e g }.

-- 
David Kastrup




reply via email to

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