On 2020-07-19 11:16 am, Fr. Samuel Springuel wrote:
Is there a way for a music function to operate on the note that precedes it?

Rather than try to work around the plumbing of LilyPond, might I suggest the following:

%%%%
\version "2.20.0"

noteTemplate =
#(define-scheme-function
  (reference-note) (ly:music?)
  (define-music-function
    (pitch) (ly:pitch?)
    (let ((note (ly:music-deep-copy reference-note)))
      (ly:music-set-property! note 'pitch pitch)
      note)))

middle = \noteTemplate 2^"*"
final = \noteTemplate 2.--

\fixed c' { \cadenzaOn a4 g \middle b g8[ f] g4_( \final c') \bar "|" }
\fixed c' { \cadenzaOn g4 f8[ d] e4 \middle e g4 a \final g \bar "|" }
%%%%

This approach allows you to create a template of sorts for individual notes. Above is an example usage to aid with pointing, supporting the middle of a phrase and the final tone.


-- Aaron Hill

Reply via email to