[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Arguments before functions
From: |
Aaron Hill |
Subject: |
Re: Arguments before functions |
Date: |
Sun, 19 Jul 2020 13:43:03 -0700 |
User-agent: |
Roundcube Webmail/1.4.2 |
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
note-template.cropped.png
Description: PNG image