スラーの調整(その2)

 「大譜表をまたぐスラーの調整」で、「相対値の方が調整しやすい」のに、と思っていたのだが、LSR (LilyPond Snippet Repository)そのものずばりのコードがあった。LilyPond-user メーリングリスト2011-03/msg00126 からの情報。

\version "2.12.0" \paper { indent = 0 line-width = 18 \cm } % Taken fron LSR 639, https://lsr.di.unimi.it/LSR/Item?id=639 shapeSlur = #(define-music-function (parser location offsets) (list?) #{ \once \override Slur #'control-points = #(alter-curve $offsets) #}) #(define ((alter-curve offsets) grob) (let ((coords (ly:slur::calc-control-points grob))) (define (add-offsets coords offsets) (if (null? coords) '() (cons (cons (+ (caar coords) (car offsets)) (+ (cdar coords) (cadr offsets))) (add-offsets (cdr coords) (cddr offsets))))) (add-offsets coords offsets))) \relative c' { \key bes \major \stemUp \slurUp es'4^\markup { default } ( as8 bes b4 e,4 | a,4 e4 b c ) | \bar "||" \shapeSlur #'(0 -2 0 2 0 0 0 -1) es'4^\markup "\\shapeSlur #'(0 -2 0 2 0 0 0 -1)" ( as8 bes b4 e,4 | a,4 e4 b c ) | }

(2011/10/29 作成)