X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Ftest%2Fmusic-box.ly;h=9e5b09cdb8e3b23c64309e87c2c42cee75169937;hb=dffe9705366ffb44b30af7a7d3d314c752ac93d5;hp=91182ee3c58f7c7b99ea80a73e965ff1e0d605a4;hpb=feb0b96b015c19f2c215326689924acabce0c9a5;p=lilypond.git diff --git a/input/test/music-box.ly b/input/test/music-box.ly index 91182ee3c5..9e5b09cdb8 100644 --- a/input/test/music-box.ly +++ b/input/test/music-box.ly @@ -1,4 +1,6 @@ -\version "2.3.1" +\version "2.10.0" +\sourcefilename "music-box.ly" + \include "deutsch.ly" % possible rename to scheme- something. -gp % TODO: ask if it needs to have so many empty bars in the middle. -gp @@ -9,10 +11,9 @@ using Scheme functions to avoid typing work. " } #(define (transform music) (let* ((es (ly:music-property music 'elements)) - (n (ly:music-name music)) - ) - (if (not (equal? n "Sequential_music")) - (ly:warn "transform needs sequential music!") + (n (ly:music-property music 'name))) + (if (not (equal? n 'SequentialMusic)) + (ly:warning "transform needs SequentialMusic, got ~a" n) (begin (let recurse ((elts es)) (if (not (equal? elts '())) @@ -20,14 +21,9 @@ using Scheme functions to avoid typing work. " } ((trans (ly:music-property (cadr elts) 'elements)) (car elts)) (set-cdr! elts (cddr elts)) (recurse (cdr elts)) - ) - ) - ) - ) - ) + ))))) music - ) - ) + )) #(define ((trans pitches) music) (let* ((es (ly:music-property music 'elements)) @@ -52,93 +48,99 @@ using Scheme functions to avoid typing work. " } (pnew (ly:music-property (car pes) 'pitch)) ) (ly:music-set-property! music 'pitch pnew) - ) - ) - music - ) - ) - - - + )) + music)) -\version "2.3.1" - -pat = \notes \transpose c c' \repeat unfold 2 { - << { \context Staff=up {r8 e16 f g e f g } } - { \context Staff=down << - \context Voice=vup { \stemUp \tieUp r16 d8.~d4 } - \context Voice=vdwn { \stemDown c2 } +pat = \transpose c c' \repeat unfold 2 { + << { \context Staff = "up" {r8 e16 f g e f g } } + { \context Staff = "down" << + \context Voice = "vup" { \stemUp \tieUp r16 d8.~d4 } + \context Voice = "vdwn" { \stemDown c2 } >> } >> } -enda = \notes { r8 f,16 a, c f c a, \stemUp c \change Staff = down - a, f, a, f, d, f, d, \change Staff = up \stemBoth +enda = { r8 f,16 a, c f c a, \stemUp c \change Staff = down + a, f, a, f, d, f, d, \change Staff = up \stemNeutral r8 g16 h d' f' d' h d' h g h d f e\prall d 1^\fermata \bar "|." } -endb = \notes {\stemUp \tieUp r16 c,8.~c,4~c,2 r16 h,,8.~h,,4~h,,2 c,1 \bar "|."} -endc = \notes {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata } +endb = {\stemUp \tieUp r16 c,8.~c,4~c,2 r16 h,,8.~h,,4~h,,2 c,1 \bar "|."} +endc = {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata } + + +prelude = +#(define-music-function (parser location patterns) (ly:music?) + (transform patterns)) + \score { - \notes \transpose c c' \context PianoStaff << - \context Staff=up { \clef "G" } - \context Staff=down { \clef "F" } - { \applymusic #transform {\pat {c e g c' e' } - \pat {c d a d' f' } - \pat {h, d g d' f' } - \pat {c e g c' e' } - } - - %{ - %Etc. - - %we get the idea now. - - - - \pat {c e a e' a' } - \pat {c d fis a d' } - \pat {h, d g d' g' } - \pat {h, c e g c' } - \pat {a, c e g c' } - \pat {d, a, d fis c' } - \pat {g, h, d g h } - \pat {g, b, e g cis' } - \pat {f, a, d a d' } - \pat {f, as, d f h } - \pat {e, g, c g c' } - \pat {e, f, a, c f } - \pat {d, f, a, c f } - - \pat {g,, d, g, h, f } - \pat {c, e, g, c e } - \pat {c, g, b, c e } - \pat {f,, f, a, c e } - \pat {fis,, c, a, c es } - \pat {as,, f, h, c d } - \pat {g,, f, g, h, d } - \pat {g,, e, g, c e } - \pat {g,, d, g, c f } - \pat {g,, d, g, h, f } - \pat {g,, es, a, c fis } - \pat {g,, e, g, c g } - \pat {g,, d, g, c f } - \pat {g,, d, g, h, f } - \pat {c,, c, g, b, e } - %} - } - >> - \paper { + \transpose c c' \context PianoStaff << + \new Staff = "up" { \clef "G" } + \new Staff = "down" { \clef "F" } + { \prelude { + \pat {c e g c' e' } + \pat {c d a d' f' } + } + +%{ + %Etc. + + %we get the idea now. + + + \pat {h, d g d' f' } + \pat {c e g c' e' } + + \pat {c e a e' a' } + \pat {c d fis a d' } + \pat {h, d g d' g' } + \pat {h, c e g c' } + \pat {a, c e g c' } + \pat {d, a, d fis c' } + \pat {g, h, d g h } + \pat {g, b, e g cis' } + \pat {f, a, d a d' } + \pat {f, as, d f h } + \pat {e, g, c g c' } + \pat {e, f, a, c f } + \pat {d, f, a, c f } + + \pat {g,, d, g, h, f } + \pat {c, e, g, c e } + \pat {c, g, b, c e } + \pat {f,, f, a, c e } + \pat {fis,, c, a, c es } + \pat {as,, f, h, c d } + \pat {g,, f, g, h, d } + \pat {g,, e, g, c e } + \pat {g,, d, g, c f } + \pat {g,, d, g, h, f } + \pat {g,, es, a, c fis } + \pat {g,, e, g, c g } + \pat {g,, d, g, c f } + \pat {g,, d, g, h, f } + \pat {c,, c, g, b, e } +%} + } + >> + + \layout { + \context { + \PianoStaff + \override VerticalAlignment #'forced-distance = #10 + } + line-width = 18.0 \cm + } + + + \midi { \context { - \PianoStaffContext - \override VerticalAlignment #'forced-distance = #10 + \Score + tempoWholesPerMinute = #(ly:make-moment 80 4) + } } - linewidth = 18.0 \cm - } - \midi { - \tempo 4 = 80 - } + }