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 Kastrup
Subject: Re: Pitch value of previous note
Date: Fri, 30 Apr 2021 12:45:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

David Sumbler <david@aeolia.co.uk> writes:

> 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
>> > theabsolute pitch of a note, it must have a record of the absolute
>> > pitchof the previous note, even if there have been some intervening
>> > rests. It seems probable that it has this information in all cases,
>> > whetherrelative pitch notation is being used or not.
>> 
>> No.  \relative is a purely transformative function that takes music
>> asinput and produces music (with a wrapping container of
>> typeRelativeOctaveMusic that prevents further applications of
>> \relative fromhaving an effect).
>> This happens immediately as a transform when \relative is
>> beingexecuted.
>> > How can I access the pitch value of this most recent note for use
>> > in aScheme function after some rests?
>> 
>> Other value-propating mechanisms exist for default durations
>> (attachedby the parser upon reading expressions), pitch-less
>> durations (addedduring 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
>> whichphase of LilyPond's interpretation you would want to be
>> interferingwith, so it would probably make more sense to present the
>> problem youare trying to solve rather than guess about the tools you
>> think LilyPondmust be using internally.
>
> I want to be able to insert a note of the same pitch as the preceding
> one.

No, you want LilyPond to do that.  But you fail to say when you want it
to do that and why you want it to do that, and why the existing input
methods don't cover it.

> 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.

How about you give an example of what you want to do?  As long as you
talk generics about LilyPond internals you assume must be there
somewhere, it is completely impossible to figure out whether one can map
what LilyPond has to what you want to achieve.

-- 
David Kastrup



reply via email to

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