lilypond-user
[Top][All Lists]
Advanced

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

Re: relative mode occasionally gets forgotten?


From: David Pounder
Subject: Re: relative mode occasionally gets forgotten?
Date: Fri, 15 May 2009 19:09:58 +0100

> ------- Original Message -------
> From: "Anthony W. Youngman" <address@hidden>
> To: address@hidden
> Sent: 15.5.09, 18:03:43
> Subject: Re: relative mode occasionally gets forgotten?
> 
> In message <address@hidden>, Graham Percival 
> <address@hidden> writes
> >On Fri, May 15, 2009 at 06:46:39AM -0600, Carl D. Sorensen wrote:
> >>
> >> First, I think that the information above should be put into 1.1.1 Writing
> >> Pitches as examples under Relative octave entry.  There should be three
> >> separate items/examples:
> >>
> >> When relative blocks are nested, the innermost relative block applies.
> >>
> >> \relative c' { d e f \relative c'' { d e f}}
> >
> >Woah, that's froody!  I would have never expected that!
> >
> >> Note:  I haven't tested any of these examples.
> >
> >I tested the above, because I just couldn't believe it.  Anyway, I
> >agree with these proposals.
> >
> When I first saw Chip's example, my reaction was "why on earth would you 
> want to do that?"
> 
> As I understand it, \relative converts from note names to absolute 
> pitches. Pretty much everything else in lily works on pitches. In a .ly 
> file you don't know, on seeing a "c", which c it is - middle, top, low, 
> whatever. If it's wrapped in a \relative{}, that assigns a pitch to it. 
> Anything else on seeing it assumes it's "c in the bass clef" as that's 
> the pitch assigned to the note "c".
> 
> So, I don't know how to word it, but when you're talking about \relative 
> in the manual it should say that you should only use \relative 
> immediately around your note names because it converts note names to 
> absolute pitches. If there's another operator inside your \relative (ie 
> in Chip's case, a \transpose, in the example above an inner \relative) 
> that forces absolute pitches, then the \relative will do nothing because 
> it doesn't know what to do with a pitch.
> 
> Cheers,
> Wol
> -- 
> Anthony W. Youngman - address@hidden
> 

I don't know if it's worth mentioning, but you can also run into problems using 
\repeat inside a \relative block if an \unfoldRepeats is used outside the 
block. For example in

Tune = \relative c' { \partial 4 d4 |
    \repeat volta 2 { c4 d e g | }
}

the first c will be relative to the last g on the second play through using 
\unfoldRepeats. Rewriting as

Tune = { \partial 4 d'4 |
    \repeat volta 2 \relative c' { c4 d e g | }
}

resolves the problem. I try to make sure I keep \relatives at the innermost 
block for this reason. Is this a case of programming style, and should the docs 
cover it?




reply via email to

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