X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Fregression%2Ftie-chord.ly;h=2688680580f5d32c7bcb9baddc8f84cc05dbf9cf;hb=8cd1548d4177af5d2ca386a4574ce9cbdc97aa96;hp=a06cade46a516bef015d9b05124e58dc6d0038ba;hpb=92af852338c1d4af070893f89afc43889f0182e6;p=lilypond.git diff --git a/input/regression/tie-chord.ly b/input/regression/tie-chord.ly index a06cade46a..2688680580 100644 --- a/input/regression/tie-chord.ly +++ b/input/regression/tie-chord.ly @@ -13,60 +13,91 @@ each system. " } -\version "2.7.7" +\version "2.12.0" \paper { indent = #0.0 - raggedright = ##t + ragged-right = ##t +} + + + +generateTiePattern += #(define-music-function (parser location is-long chords) (boolean? ly:music?) + + " + +translate x y z to x~x y~y z~z + +" + + (define (chord->tied-chord chord) + (let* + ((ch1 (ly:music-deep-copy chord)) + (ch2 (ly:music-deep-copy chord)) + (dur1 (ly:make-duration + (if is-long + 1 2))) + (dur2 (ly:make-duration + (if is-long + 3 2)))) + + (for-each (lambda (e) + (ly:music-set-property! e 'duration dur1)) + (ly:music-property ch1 'elements)) + + (for-each (lambda (e) + (ly:music-set-property! e 'duration dur2)) + (ly:music-property ch2 'elements)) + + (set! (ly:music-property ch1 'elements) + (cons + (make-music 'TieEvent) + (ly:music-property ch1 'elements))) + + (list ch1 ch2))) + + (make-music 'SequentialMusic 'elements (apply append + (map chord->tied-chord (ly:music-property chords 'elements))))) + +baseChords = +\applyMusic #(lambda (mus) + (ly:music-property mus 'element)) +\relative c'' { + + + + + + + + + + + } testShort = { - \time 4/4 \key c \major - \relative c'' { - % c ~ c - ~ - ~ - ~ - ~ - ~ - } - - \relative c' { - ~ - ~ - - ~ - ~ - ~ - } + \generateTiePattern ##f \baseChords } testLong = { - \time 5/8 \key c \major - \relative c'' { - 2 ~ 8 - 2 ~ 8 - 2 ~ 8 - 2 ~ 8 - 2 ~ 8 - } - - \relative c' { - 2 ~ 8 - 2 ~ 8 - 2 ~ 8 - 2 ~ 8 - } + \generateTiePattern ##t \baseChords } \new Voice -{ \testShort \break +{ + \time 2/4 + + \testShort \break \transpose c d \testShort \break + \time 5/8 \testLong \break \transpose c d \testLong \break } +