On Sat 24 Oct 2026 at 12:55:52 (+0200), Paul Crabbe wrote:
> 
> When using temporary polyphony syntax, in a \relative notation context,  I 
> stumble on a recurring problem : changing one note height in one voice will 
> affect octave positionnig on other voice : 
> 
> %========================================================================
> 
> \relative c'' {
>     <<
>       {c e c g}\\
>       {c, c c c}
>     >>
> }
> 
> % changing last note on \voice 1 will move \voice 2 one octave up : 
> \relative c'' {
>     <<
>       {c e c g'}\\
>       {c, c c c}
>     >>
> }
> 
> % ----------------------------------------------------------
> 
> % reaffirming \relative for each voice seems to prevent this behavior : 
> \relative c'' {
>     <<
>       \relative c'' {c e c g}\\
>       \relative c'' {c, c c c}
>     >>
> }
> 
> \relative c'' {
>     <<
>       \relative c'' {c e c g'}\\
>       \relative c'' {c, c c c}
>     >>
> }
> 
> %========================================================================
> 
> 
> I would be happy to fully understand what's going on under the hood here.

At the risk of repeating some of what has already been said, the
\relative { }, \fixed { } and \absolute { } constructions are input
methods/shorthands that have the effect of "baking in" the octavation
of the enclosed notes. A naked { } leaves them floating, uncommitted
until they are used.

So in your second example, the enclosing \relative c'' has actually
been made impotent because the inner \relative's have already baked
those notes into absolute pitches. It could just as well have been
written as \relative c,, instead.

Here's an example of uncommitted notes, where \jjj is set differently
according to where it is placed:

%%
 
jjj = { c g c }
 
\relative c'' {
  <<
    { c e c g } \\
    { c, \jjj }
  >>
}
 
\relative c'' {
  <<
    { c e c g' } \\
    { c, \jjj }
  >>
}
 
%%

By way of contrast, \kkk below is always set at the same octave:

%%
 
kkk = \absolute { c g c }
 
\relative c'' {
  <<
    { c e c g } \\
    { c, \kkk }
  >>
}
 
\relative c'' {
  <<
    { c e c g' } \\
    { c, \kkk }
  >>
}
 
%%

The last example shows a few other points:
you can specify the relative octave with the first enclosed note,
IOW as if it was written \relative f { };
baked-in sequences of music included within a \relative { } sequence
do not affect the \relative's own octavation outside the inclusions;
and enclosed sequences do not pick up the notelengths preceding them.

%%
 
unbaked = { g e e c }
baked = \absolute { g e e c }
 
\relative {
  c' e g2 c \unbaked e g c \baked c e c
}
 
%%

BTW I would recommend using \relative { } et al only as input methods
for variables like \voice's and simple lines of music, and not
writing any \staff or larger structures within them.

Cheers,
David.

Attachment: examples.pdf
Description: Adobe PDF document

Reply via email to