lilypond-user
[Top][All Lists]
Advanced

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

Re: Tangled up in Lilypond syntax


From: Aaron Hill
Subject: Re: Tangled up in Lilypond syntax
Date: Wed, 27 Mar 2019 16:05:42 -0700
User-agent: Roundcube Webmail/1.3.8

On 2019-03-27 3:35 pm, Flaming Hakama by Elaine wrote:

---------- Forwarded message ----------
From: Kieren MacMillan <address@hidden>
To: Guy Stalnaker <address@hidden>
Cc: Tim Slattery <address@hidden>, Lilypond-User Mailing List <
address@hidden>
Date: Tue, 26 Mar 2019 15:16:03 -0400
Subject: Re: Tangled up in Lilypond syntax
Hi Guy,

> While I don't use \relative

Good choice.  =)

The issue is not \relative, per se.  I wish people would stop maligning
it.   Although I'm sure this commentary is all in good fun.
The issue is not using it correctly.

I tend to think of something like \relative to be a lower-level construct, intended to be used as close as possible to the pitches in question. Since I try to keep things organized in variables where content and structure are not intermixed, \relative never appears at a higher-level scope in my work.

The only time I have to be careful with \relative is when using \tagged expressions:

%%%%
melody = \relative c' {
  | c4 d \tag #'varIA { e2 }
         \tag #'varIB { e8 f g4 }
  | c4 d c2
}
%%%%

I employ this pattern as often melody lines will vary from stanza to stanza, but I wish to avoid unnecessary duplication. The intention is that only one of the variations will be active. However, I have to remember that \relative will apply before tagged music is removed. (The corresponding \keepWithTag occurs at the Score level in my usage.) That means the g4 ending the second variation will force the following c4 up an octave compared to the initial c4. Of course, this behavior is actually a good thing, as it ensures the music is always interpreted consistently, regardless of the presence or absence of tagged expressions.

But it has on occasion surprised me when I forgot to compensate for the shifting octave. And more often than not, it is just plain user error where I intended to type a comma and typed an apostrophe. Always fun watching your melody lines run off the edge of the paper. ;-)

-- Aaron Hill



reply via email to

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