lilypond-user
[Top][All Lists]
Advanced

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

Re: Nested transposition


From: David Wright
Subject: Re: Nested transposition
Date: Fri, 12 Mar 2021 22:03:26 -0600
User-agent: Mutt/1.10.1 (2018-07-13)

On Fri 12 Mar 2021 at 16:30:07 (-0800), Flaming Hakama by Elaine wrote:
> It seems we can't be too pedantic here.
> 
> Based on the OP's situation,
> one can imaging that the original piece might have looked like:
> 
> \relative {
>     c'4 d e f g a b c
>     cs, ds es fs gs as bs cs
> }
> 
> Then the attempt to transpose down a 3rd:
> 
> \transpose c a, {
>     \relative {
>         c'4 d e f g a b c
>         cs, ds es fs gs as bs cs
>     }
> }
> 
> 
> Then--and here is the crucial part--they decided to break up the original
> \relative into two expressions, so they could transpose one of them
> enharmonically.
> 
> Before applying the enharmonic transposition,
> here is what the new structure would look like:
> 
> \relative {
>     c'4 d e f g a b c
>     { cs, ds es fs gs as bs cs }
> }
> 
> Note that the inner { } is treated as a continuation of the first relative
> expression.  This can be seen in two ways:  the first { cs, } is in the
> octave of middle C and not two octaves below, which is what \fixed { cs, }
> would be.  Likewise, the ds is a step above cs, not a 7th below.

(\absolute, presumably, not \fixed.)

> However, this is lazy, since it is not explicitly saying the inner { } is
> relative, it is relying on the fact that it is nested in a relative
> expression.
> 
> So, you run into problems when you add the \transpose before it, or do any
> number of other things with it, like cut & paste into other expressions, or
> call other functions with it as an argument.
> 
> The \transpose function now views the { } expression as fixed, and it is no
> longer relative to the context of the containing \relative { }
> 
> 
> The non-lazy approach would be to supply the \relative when breaking up
> this expression.
> 
> We can debate about whether using the default \relative { } versus
> \relative c { } is better, but that is besides the point.
> 
> The main point is that you need to start a new \relative expression, and
> when you do so, you need to specify the octave of the first note again,
> since it is no longer relative to the previous note.
> 
> So, for breaking up the first expression into two, you would want either of
> these:
> 
> \relative {
>     c'4 d e f g a b c
>     \relative { cs'4 ds es fs gs as bs cs }
> }
> 
> \relative c' {
>     c4 d e f g a b c
>     \relative c' { cs4 ds es fs gs as bs cs }
> }

It's a fascinating narrative, full of excuses/reasons for how the OP
got to what they posted, but to say that I would want to write, a priori,
either of the snippets above is — unlikely, IMHO. (ameliorated.)
It's certainly not, as you said: "best practice".

As for { … } being a "lazy" construction, it's quite usual to group
relative notes in braces for various reasons without the necessity to
relative-ise each group separately. For example, repeats,
alternatives, tuplets, etc.

The point is that you know what's coming, transpose, …

> That is all that is needed, to be able to add \tranpsose and have it work
> properly.  The transposition works as intended, once you make sure the
> notes you are transposing are defined correctly.

… and it's only the \transpose which means you have to write the notes
in that manner for them to be "defined correctly".

> \transpose c a, {
>     \relative {
>         c'4 d e f g a b c
>         \transpose as bf \relative { cs'4 ds es fs gs as bs cs }
>     }
> }

That's a very roundabout way of stating that music inside \transpose { }
is interpreted as absolute. It's only on page 4 of NR, not buried away
somewhere. The mistake was that the OP either forgot or did not know this,
not laziness in "breaking up an expression".

> The core issue here is that a relative expression was broken up lazily.
> Then when used as the argument to \transpose, it was silently and
> inadvertently cast to a fixed expression.
> 
> The key takeaway is to be explicit when breaking up relative expressions.
> 
> I don't think there is anything wrong with \transpose.

Of course there isn't anything wrong with it. But if you want to use
relative input inside it, you just have to put it inside \relative { }.
There's even an example on page 4 showing this.

The only thing I would add to that example (either within it or extra)
is a reminder about the pitches of these trailing notes • :

\relative { … … … \transpose { = = = } ••• ••• }

which are interpreted as if:

\relative { … … …                      ••• ••• }

On Fri 12 Mar 2021 at 21:22:01 (-0500), Kieren MacMillan wrote:
> oof
> this thread reminds me why I gave up using \relative over a decade ago and 
> never looked back

Just couldn't stop yourself.

Cheers,
David.



reply via email to

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