lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the problem with "\relative"? (Was: Do we really offer the f


From: Simon Albrecht
Subject: Re: What is the problem with "\relative"? (Was: Do we really offer the future?)
Date: Sat, 25 Apr 2015 12:34:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

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



reply via email to

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