3 texidoc = "This example shows prelude in C major of WTK1, but coded
4 using Scheme functions to save typing work.
11 composer = "Johann Sebastian Bach (1685-1750)"
12 enteredby = "Rune Zedeler"
13 mutopiatitle = "Das Wohltemperierte Clavier I, Prelude 1 (c-major)"
14 mutopiacomposer = "J.S.Bach"
15 mutopiaopus = "BWV846"
16 mutopiainstrument = "Piano"
18 copyright = "Public Domain"
19 maintainer = "rz@daimi.au.dk"
20 lastupdated = "2001/mar/30"
21 tagline = "\\parbox{\hsize}{\\thefooter\\quad\\small \\\\This music is part of the Mutopia project, \\texttt{http://www.mutopiaproject.org/}\\\\It has been typeset and placed in the public domain by " + \maintainer + ".\\\\Unrestricted modification and redistribution is permitted and encouraged---copy this music and share it!}"
27 #(define (transform music)
28 (let* ((es (ly:get-mus-property music 'elements))
29 (n (ly:music-name music))
31 (if (not (equal? n "Sequential_music"))
32 (ly:warn "transform needs sequential music!")
34 (let recurse ((elts es))
35 (if (not (equal? elts '()))
37 ((trans (ly:get-mus-property (cadr elts) 'elements)) (car elts))
38 (set-cdr! elts (cddr elts))
49 #(define ((trans pitches) music)
50 (let* ((es (ly:get-mus-property music 'elements))
51 (e (ly:get-mus-property music 'element))
52 (p (ly:get-mus-property music 'pitch)))
57 (map (trans pitches) es)))
65 (let* ((o (ly:pitch-octave p))
66 (n (ly:pitch-notename p))
68 (pes (ly:get-mus-property (list-ref pitches i) 'elements))
69 (pnew (ly:get-mus-property (car pes) 'pitch))
71 (ly:set-mus-property! music 'pitch pnew)
84 pat = \notes \transpose c c' \repeat unfold 2 {
85 < { \context Staff=up {r8 e16 f g e f g } }
86 { \context Staff=down <
87 \context Voice=vup { \stemUp \tieUp r16 d8.~d4 }
88 \context Voice=vdwn { \stemDown c2 }
93 enda = \notes { r8 f,16 a, c f c a, \stemUp c \translator Staff = down
94 a, f, a, f, d, f, d, \translator Staff = up \stemBoth
95 r8 g16 h d' f' d' h d' h g h d f e-\prall d <<e g c'>>1^\fermata \bar "|."
97 endb = \notes {\stemUp \tieUp r16 c,8.~c,4~c,2 r16 h,,8.~h,,4~h,,2 c,1 \bar "|."}
98 endc = \notes {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata }
101 \notes \transpose c c' \context PianoStaff <
102 \context Staff=up { \clef "G" s1*32 \enda }
103 \context Staff=down { \clef "F" s1*32 < \context Voice=vup \endb
104 \context Voice=vdwn \endc
106 { \apply #transform {\pat {c e g c' e' }
115 \pat {d, a, d fis c' }
117 \pat {g, b, e g cis' }
124 \pat {g,, d, g, h, f }
127 \pat {f,, f, a, c e }
128 \pat {fis,, c, a, c es }
129 \pat {as,, f, h, c d }
130 \pat {g,, f, g, h, d }
131 \pat {g,, e, g, c e }
132 \pat {g,, d, g, c f }
133 \pat {g,, d, g, h, f }
134 \pat {g,, es, a, c fis }
135 \pat {g,, e, g, c g }
136 \pat {g,, d, g, c f }
137 \pat {g,, d, g, h, f }
138 \pat {c,, c, g, b, e }
145 VerticalAlignment \override #'forced-distance = #10
154 %% new-chords-done %%