Am 25.04.2015 um 00:38 schrieb Thomas Morley:
Hi all,

I'm a little late to the party...

One very annoying thing about \relative is when you want to use
music-functions catching some music doing something with it.

Here the less complex function I could think of, returning different
results for absolute and relative.
(It's only a show-case, the functionality could be achieved easily
with other predefined commands, but I hope you'll get the point.)

repeat-note =
#(define-music-function (parser location music)(ly:music?)
   (make-sequential-music (list music (ly:music-deep-copy music))))

\absolute { c'1 \repeat-note c'' }
\relative c' { c \repeat-note c'1 }
Well, either we require doing

\version "2.19.17"

repeat-abs-note =
#(define-music-function (parser location music)(ly:music?)
   (let ((music #{ \absolute $music #}))
     (make-sequential-music (list music (ly:music-deep-copy music)))))

\absolute { c'1 \repeat-abs-note c'' }
\relative c' { c \repeat-abs-note c''1 }

or we consider this a bug in (or enhancement request to) (ly:music-deep-copy), towards which I’m inclined.

Yours, Simon

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to