]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/test/music-box.ly
* lily/paper-book.cc (output): load framework module
[lilypond.git] / input / test / music-box.ly
index 84933d33d21d72f753b651f4e568d112938b15a5..7b3a2583fc22b15a35d43705433d0bf2fd39646c 100644 (file)
@@ -1,31 +1,14 @@
-
-\header{
-texidoc = "This example shows prelude in C major of WTK1, but coded
-using Scheme functions to save typing work.
-"
-
-
-
-  title =  "Preludium"
-  opus =   "BWV 846"
-  composer = "Johann Sebastian Bach (1685-1750)"
-  enteredby = "Rune Zedeler"
-  mutopiatitle = "Das Wohltemperierte Clavier I, Prelude 1 (c-major)"
-  mutopiacomposer = "J.S.Bach"
-  mutopiaopus = "BWV846"
-  mutopiainstrument = "Piano"
-  style = "baroque"
-  copyright = "Public Domain"
-  maintainer = "rz@daimi.au.dk"
-  lastupdated = "2001/mar/30"
-  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!}"
-}
-
+\version "2.3.2"
 \include "deutsch.ly"
-\version "1.7.16"
+% possible rename to scheme- something.  -gp
+% TODO: ask if it needs to have so many empty bars in the middle.  -gp
+\header{ texidoc = "@cindex Scheme Music Box
+This example shows prelude in C major of WTK1, but coded
+using Scheme functions to avoid typing work. " }
+
 
 #(define (transform music)
-  (let* ((es (ly:get-mus-property music 'elements))
+  (let* ((es (ly:music-property music 'elements))
          (n  (ly:music-name music))
         )
    (if (not (equal? n "Sequential_music"))
@@ -34,7 +17,7 @@ using Scheme functions to save typing work.
       (let recurse ((elts es))
        (if (not (equal? elts '()))
         (begin
-           ((trans (ly:get-mus-property (cadr elts) 'elements)) (car elts))
+           ((trans (ly:music-property (cadr elts) 'elements)) (car elts))
           (set-cdr! elts (cddr elts))
           (recurse (cdr elts))
         )
@@ -47,17 +30,17 @@ using Scheme functions to save typing work.
  )
 
 #(define ((trans pitches) music)
-  (let* ((es (ly:get-mus-property music 'elements))
-         (e (ly:get-mus-property music 'element))
-         (p (ly:get-mus-property music 'pitch)))
+  (let* ((es (ly:music-property music 'elements))
+         (e (ly:music-property music 'element))
+         (p (ly:music-property music 'pitch)))
 
     (if (pair? es)
-        (ly:set-mus-property!
+        (ly:music-set-property!
          music 'elements
          (map (trans pitches) es)))
 
     (if (ly:music? e)
-        (ly:set-mus-property!
+        (ly:music-set-property!
          music 'element
          ((trans pitches) e)))
 
@@ -65,10 +48,10 @@ using Scheme functions to save typing work.
        (let* ((o (ly:pitch-octave p))
               (n (ly:pitch-notename p))
               (i (+ (* 7 o) n))
-             (pes (ly:get-mus-property (list-ref pitches i) 'elements))
-             (pnew (ly:get-mus-property (car pes) 'pitch))
+             (pes (ly:music-property (list-ref pitches i) 'elements))
+             (pnew (ly:music-property (car pes) 'pitch))
              )
-          (ly:set-mus-property! music 'pitch pnew)
+          (ly:music-set-property! music 'pitch pnew)
        )
     )
     music
@@ -79,34 +62,41 @@ using Scheme functions to save typing work.
 
 
 
-\version "1.7.16"
+\version "2.3.2"
 
 pat = \notes \transpose c c' \repeat unfold 2 {
-  < { \context Staff=up {r8 e16 f g e f g } }
-    { \context Staff=down <
+  << { \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 \translator Staff = down
-      a, f, a, f, d, f, d, \translator Staff = up \stemBoth
-      r8 g16 h d' f' d' h d' h g h d f e-\prall d <<e g c'>>1^\fermata \bar "|."
+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
+      r8 g16 h d' f' d' h d' h g h d f e\prall d <e g c'>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 }
 
 \score {
-  \notes \transpose c c' \context PianoStaff <
-    \context Staff=up   { \clef "G" s1*32 \enda }
-    \context Staff=down { \clef "F" s1*32 < \context Voice=vup \endb
-                                            \context Voice=vdwn \endc
-                       > }
-    { \apply #transform {\pat {c e g c' e' }
+  \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' }
@@ -136,13 +126,13 @@ endc = \notes {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata }
                         \pat {g,, d, g, c f }
                         \pat {g,, d, g, h, f }
                         \pat {c,, c, g, b, e }
-                       }
+                       %}
     }
-  >
+  >>
   \paper {
-    \translator {
-      \PianoStaffContext
-      VerticalAlignment \override #'forced-distance = #10
+    \context {
+      \PianoStaff
+      \override VerticalAlignment #'forced-distance = #10
     }
 
     linewidth = 18.0 \cm
@@ -151,4 +141,4 @@ endc = \notes {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata }
       \tempo 4 = 80
   }
 }
-%% new-chords-done %%
+