lilypond-user
[Top][All Lists]
Advanced

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

Re: Proposed new available and recommended behavior of \relative


From: Wim van Dommelen
Subject: Re: Proposed new available and recommended behavior of \relative
Date: Sun, 10 Mar 2013 10:33:58 +0100


On 10 Mar 2013, at 10:06 , David Kastrup wrote:

Wim van Dommelen <address@hidden> writes:

Agree, we should have an easy way to switch from absolute to relative
(Yes, everthing inside \relative { } is relative, all other is
absolute, I know), like: \absolute: from here on everything is
absolute like \clef bass tells me: from here on display everything in
the bass clef.

Barely tongue-in-cheek:

absolute =
#(define-music-function (parser location music) (ly:music?)
  (make-music 'TransposedMusic 'element music))

When placed inside of a \relative block, \relative will route around
this music.  It stays in absolute pitch and does not even touch the
reference pitch of \relative.  This might be somewhat useful in
connection with music variables:

melody = \absolute { c'4 e' g' c' }

\relative f { c''4. g'8 c,2 \melody d4 e f c }

Not quite what I had in mind, this is still using a "wrap" with { }

Compared with the \clef behaviour, I see this variant:

melody = { \relative c='4 d e f g f e d c \absolute c,, d,, e,, f,, g,, \relative c=' d e f }

The { } only wrap the notes for the variable to be defined. The sequence switches from a relative section based on the c=', then to absolute notes and then back to relative again. See it as switching to another state of mind, no { } with the \relative needed. \clef switches to another clef without the need to wrap the rest of your music in curly brackets.

mixedclefabsolute = { \absolute \clef bass c4 d e f g a b \clef treble c' d' e' f' g' a' b' c'' }


If you wrote just

melody = { c'4 e' g' c' }

here, things would go rather haywire.

True :-(, but I would probably say:

melody = { \absolute c'4 e' g' c' }

which should hold in any copy&paste, transpose, etc.


--
David Kastrup


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




reply via email to

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