Comment #6 on issue 4366 by [email protected]: absolute entry mode with less typing
https://code.google.com/p/lilypond/issues/detail?id=4366

It should stay on review to give people a chance to try it, which they can do by putting the definitions below at the top of their LilyPond input.

There is the usual question about naming, and which syntax \absolute 2 or \absolute c'' to use to indicate the home octave. There is one open question on behavior, whether the home-octave should affect a \relative or \absolute block nested inside the music.
  \fixed c' { c4 e g c \relative c' {c4 e g c}}
  \absolute c' { c4 e g c \relative c' {c4 e g c}}

absolute =
#(define-music-function (parser location pitch music)
   ((ly:pitch?) ly:music?)
   (_i "Make @var{music} absolute.")
   (if pitch
     (ly:music-transpose music
        (ly:make-pitch (1+ (ly:pitch-octave pitch)) 0 0)))
   (make-music 'UnrelativableMusic 'element music))

fixed =
#(define-music-function (parser location pitch music)
   ((ly:pitch?) ly:music?)
(_i "Use the octave of @var{pitch} as the default octave for @var{music}.")
   (if pitch
       (let* ((shift (ly:make-pitch (1+ (ly:pitch-octave pitch)) 0 0))
              (unshift (ly:pitch-negate shift)))
          (map (lambda (m) (ly:music-transpose m unshift))
               (extract-named-music music
                 '(UnrelativableMusic RelativeOctaveMusic)))
          (ly:music-transpose music shift)))
   (make-music 'UnrelativableMusic 'element music))


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

Reply via email to