On Fri, 2021-04-30 at 12:15 +0200, David Kastrup wrote: > David Sumbler <da...@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. 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