]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/music-functions.scm (shift-one-duration-log): refactor.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 1 Dec 2002 18:26:40 +0000 (18:26 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 1 Dec 2002 18:26:40 +0000 (18:26 +0000)
Use music-map.

* input/regression/chord-tremolo.ly (texidoc): add dot test.

* scm/music-functions.scm (display-music): new function
(music-map): change arg order.

ChangeLog
input/regression/chord-tremolo.ly
scm/music-functions.scm

index eea9b1ea84c9f8849727bdd60c4fcec60d28bfe9..21866ecf4c53f725e26393b8561a09b427ab43d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2002-12-01  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * scm/music-functions.scm (shift-one-duration-log): refactor.
+       Use music-map.
+
+       * input/regression/chord-tremolo.ly (texidoc): add dot test.
+
        * NEWS: update.
 
        * lily/font-interface.cc (get-font): take alist chain i.s.o. alist
index f67fa4b3dc722039f640e2268c2399af016883a2..1d02ba4852c2d2c2ee6a80c73b7d770ace019513 100644 (file)
@@ -22,6 +22,9 @@ stems.
        \break
        \repeat "tremolo" 4 { f'8 e }
        \repeat "tremolo" 2 { f e }
+       c4 c4
+
+       \repeat "tremolo" 3 { f8 e }
        c4
        c4 c4 c4 c4
        c4 c4 c4 c4
@@ -33,4 +36,4 @@ stems.
   }  
   \midi { }
 }
-%% new-chords-done %%
\ No newline at end of file
+%% new-chords-done %%
index 7250dac3afe3cd6556582b83fadd9d3b83bf5ad7..434a49f64177213c4e72fdca1694f6938f8c98cd 100644 (file)
   
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-
-(define-public (shift-duration-log music shift dot)
-  "Recurse through music, adding SHIFT to ly:duration-log and optionally 
+(define (shift-one-duration-log music shift dot)
+  "  add SHIFT to ly:duration-log and optionally 
   a dot to any note encountered. This scales the music up by a factor 
   2^shift * (2 - (1/2)^dot)"
-  (let* ((es (ly:get-mus-property music 'elements))
-         (e (ly:get-mus-property music 'element))
-         (n  (ly:music-name music))
-        (f  (lambda (x)  (shift-duration-log x shift dot)))
-        (d (ly:get-mus-property music 'duration))
-        )
 
-    ;; FIXME: broken by the great music rename.
+  (let*
+      (
+       (d (ly:get-mus-property music 'duration))
+       )
     (if (ly:duration? d)
        (let* (
               (cp (ly:duration-factor d))
               (nd (ly:make-duration (+ shift (ly:duration-log d))
-                                 (+ dot (duration-dot-count d))
-                                 (car cp)
-                                 (cdr cp)))
+                                    (+ dot (ly:duration-dot-count d))
+                                    (car cp)
+                                    (cdr cp)))
               
               )
          (ly:set-mus-property! music 'duration nd)
          ))
-    
-    (if (pair? es)
-        (ly:set-mus-property!
-         music 'elements
-         (map f es)))
-    
-    (if (ly:music? e)
-        (ly:set-mus-property!
-         music 'element
-         (f e)))
-    
     music))
 
 
 
+(define-public (shift-duration-log music shift dot)
+  (music-map (lambda (x) (shift-one-duration-log x shift dot))
+            music))
+  
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; repeats.