lilypond-user
[Top][All Lists]
Advanced

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

Re: Pitch value of previous note


From: David Sumbler
Subject: Re: Pitch value of previous note
Date: Fri, 30 Apr 2021 11:39:35 +0100
User-agent: Evolution 3.36.4-0ubuntu1


On Fri, 2021-04-30 at 12:15 +0200, David Kastrup wrote:
David Sumbler <
david@aeolia.co.uk
> writes:

In a \relative{ } passage, in order for Lilypond to work out the
absolute pitch of a note, it must have a record of the absolute pitch
of the previous note, even if there have been some intervening rests.
 It seems probable that it has this information in all cases, whether
relative pitch notation is being used or not.

No.  \relative is a purely transformative function that takes music as
input and produces music (with a wrapping container of type
RelativeOctaveMusic that prevents further applications of \relative from
having an effect).

This happens immediately as a transform when \relative is being
executed.

How can I access the pitch value of this most recent note for use in a
Scheme function after some rests?

Other value-propating mechanisms exist for default durations (attached
by the parser upon reading expressions), pitch-less durations (added
during the scorifying stage when a music _expression_ is accepted into a
\score block), chord repeats (also at scorification).

"For use in a Scheme function" is too hand-waving to have an idea which
phase of LilyPond's interpretation you would want to be interfering
with, so it would probably make more sense to present the problem you
are trying to solve rather than guess about the tools you think LilyPond
must be using internally.

I want to be able to insert a note of the same pitch as the preceding one.  I don't mind what form the pitch information is in, so long as I can use it to create a new note.  It could, for example, be in the form "b,,", or something similar to "(-2, 6)" as used by ly:make-pitch.  There may be other possibilities.

David

reply via email to

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