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: Sun, 10 Mar 2013 11:01:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Wim van Dommelen <address@hidden> writes:

> melody = { \relative c='4 d e f g f e d c \absolute c,, d,, e,, f,,
> g,, \relative c=' d e f }

Executive summary: that's an unmaintainable nightmare.  If you don't
care about reading technical rants, you might as well stop reading now.

> The { } only wrap the notes for the variable to be defined. The
> sequence switches from a relative section based on the c=', then to
> absolute notes and then back to relative again.

You need reliable definitions of "sequence", "section", and "then" to
make the above sentence make any sense, and LilyPond does not have such
definitions.  Fixing this kind of fuzzy half-baked thinking was a
nightmare when I reimplemented chord repetition.

LilyPond has parser order (used for default note durations), music
expression hierarchical order (used for chord repetition, \relative,
\transpose and a number of other constructs), and temporal order (used
for synching lyrics and music, for example).

Pitch relations like \relative are rather firmly anchored into music
expressions, and music functions like \relative can't actually deal with
anything else sensibly.  Moving pitch relations elsewhere is a recipe
for disaster.  We had this with chord repetition.  I am not interested
in repeating this experience for the sake of syntax that is rather
arbitrary.

> See it as switching to another state of mind, no { } with the
> \relative needed. \clef switches to another clef without the need to
> wrap the rest of your music in curly brackets.

\clef operates in temporal order.  You can write something like

\new Voice << { c' e' \clef "bass" g c } { a c' e c, } >>

And I can even use \relative with it:

\relative c'
\new Voice << { c e \clef "bass" g, c, } { a' c e, c, } >>

Not fabulous, but one can still rather easily figure out what ends up
where and make a useful definition of "preceding", "then" and similar
regarding either the use of \clef or the relative pitches (obviously,
the definitions are different).

Now have much fun letting \relative work in a manner similar to how
\clef works.  And then explain it in simple terms to users.

Then come up with reliable rules about which of two simultaneous pitches
is supposed to be the reference pitch for the next pitch.

We don't have simultaneous clefs in a staff, you know.

-- 
David Kastrup



reply via email to

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