Re: Bug in \relative parsing?

Luca Fascione <[email protected]>
Newsgroups gmane.comp.gnu.lilypond.devel
Message-ID <CAN3Q5NiDYkzcxNYWhfoQFrjvto6TbsHbQRa8sau8asVBA6oXAA@mail.gmail.com>
Oh. I had missed freestanding durations could be a thing. Nvm then, sorry
for the noise

Luca


On Fri, 21 Aug 2026, 09:02 David Kastrup, <[email protected]> wrote:

> Luca Fascione <[email protected]> writes:
>
> > Hi folks,
> > I noticed that this
> >
> > \score {
> >   \new Staff {
> >     f
> >   \relative a'4 { c }
> >   }
> > }
> >
> > behaves unexpectedly (I'm using 2.24.4): it renders f3, f3, c3 in violin
> > clef.
> > In my head, the c3 is expected, because the \relative in this case is
> > parsed like this I'm guessing
> >
> > f \relative { a'4 } { c }
> >
> > ie. an f3 in absolute mode, an a'4 in relative mode (defaulting its
> > reference pitch to c3), then a one-note block in absolute mode. Except
> that
> > the note rendered should be a3, not f3.
>
> No, that is not a bug, and your understanding is wrong.  \relative takes
> a _pitch_ argument as its start, not a note, so this is parsed as
>
> \relative a' { 4 } { c }
>
> (braces here just for understanding, no actual sequential music is
> involved for rendering F3) with 4 being a repeat of F3 since that is the
> last pitch of a note appearing in context before it.  You could replace
> a' with a'''' and get the same result.
>
> Unpitched durations just take their pitch from the preceding note in the
> music expression.
>
> --
> David Kastrup
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.