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: Tue, 12 Mar 2013 09:34:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Graham Percival <address@hidden> writes:

> On Sat, Mar 09, 2013 at 12:20:19AM +0100, David Kastrup wrote:
>> Olivier Biot <address@hidden> writes:
>> 
>> > Treating the first pitch of \music in \relative \music differently is
>> > not intuitive and will likely result in octave errors.
>> 
>> Treating the first pitch of \music in \relative is _absolutely_
>> _unavoidable_ since the very _definition_ of relative pitches means that
>> each pitch is specified in relation to the previous pitch, and the first
>> pitch _has_ no previous pitch.
>>
>> So the first pitch will _always_ be special-cased.  With a reference
>> pitch, it is special-cased to refer to that absolute pitch.  Without a
>> reference pitch, it has to behave in _some_ manner as well.
>
> The first pitch *within the {}* doesn't need to be special-cased.
> It's just relative to the reference pitch, which is *outside* the
> {}.

So it is special-cased since every other pitch is relative to another
actually occuring pitch *within the {}*.

> I still think that we should remove \relative { without any reference
> pitch.

Well, issue 3231 does that and it is on countdown.  So this
long-standing wish from our up to now not completely followed policies
is granted at least temporarily.

So why reintroduce \relative { ... } with a different meaning right
away?  At the current point of time, there are two major variants of
\relative we try following and/or suggesting in documentation and code.

a) \relative with an octave of c

b) \relative based on the absolute pitch of the first note

For the second case, there are two possible variants.  The first, pretty
much exclusively used in LilyPond's code base and documentation, is
\relative x''' { x ...
This shows some redundancy and has the disadvantage of becoming badly
maintainable and understandable if there is significant prefatory matter
before the actual first occurence of the pitch.

The style we write tends to place things like \time, \times/\tuplet,
\clef, \key, \new Voice and so on inside of \relative, delaying the
proper occurence of the first pitch.  If an editor tries helping with
absolute/relative conversion on a region, \key is actually problematic.

The second variant that is quite feasible and pretty much unused is
\relative f { ...
This is doing the job just fine, but is looking obscure.  It makes the
user not write down his intention, but rather the mechanism by which his
intention is being implemented.

For that reason, a proposal "let's convert all the documentation to use
\relative f { ... }" would in my opinion meet significantly more
opposition than "let's have \relative { ... } means \relative f { ... },
and let's convert all the documentation to use \relative { ... }".

Now if my estimate about that is correct, it means that whether or not
we actually do that conversion in the end, having the dedicated
\relative { ... } syntax for the concept currently implemented with
\relative f { ... } would give a more natural expression to writing
"\relative based on the absolute pitch of the first note", a practice
that a significant portion of users already employs even without having
a fully satisfactory and non-distracting way of expressing just it and
nothing else.

-- 
David Kastrup



reply via email to

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