lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] rall. and accel stopped working in articulate.


From: Peter Chubb
Subject: [PATCH] rall. and accel stopped working in articulate.
Date: Wed, 14 Mar 2012 16:01:34 +1100
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Goj┼Ź) APEL/10.8 Emacs/23.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

According to the the git logs, in February 2011 the way that tempo
changes for MIDI were interpreted changed from just the
tempoWholesPerMinute property to use a TempoChangeEvent.

This broke rall. in articualed MIDI output.

This patch brings the articulate script up-to-date wrt to the way that
tempo changes are signalled, and also adds accel. and poco accel. to
the list of accepted scripts.

This patch goes on top of the one I sent earlier today to fix prall
and mordents.

Reported-by: Thomas Morley <address@hidden>
Signed-off-by: Peter Chubb <address@hidden>

diff --git a/ly/articulate.ly b/ly/articulate.ly
index d2d3b18..a345468 100644
--- a/ly/articulate.ly
+++ b/ly/articulate.ly
@@ -341,8 +341,18 @@
 ;     (ac:accel trillMusic factor))
  )))
 
-
-
+%
+% Generate a tempoChangeEvent and its associated property setting.
+%
+#(define (ac:tempoChange tempo)
+  (make-sequential-music
+   (list (make-music 'TempoChangeEvent
+         'metronome-count
+         tempo
+         'tempo-unit
+         (ly:make-duration 0 0 1 1))
+    (context-spec-music
+    (make-property-set 'tempoWholesPerMinute  tempo) 'Score))))
 
 % If there's an articulation, use it.
 % If in a slur, use (1 . 1) instead.
@@ -414,6 +424,14 @@
             (string= t "rall."))
            (loop factor (cons e newelements) tail (cons 'rall actions)))
           ((or
+            (string= t "accelerando")
+            (string= t "accel")
+            (string= t "accel."))
+           (loop factor (cons e newelements) tail (cons 'accel actions)))
+          ((or
+            (string= t "poco accel."))
+           (loop factor (cons e newelements) tail (cons 'pocoAccel actions)))
+          ((or
             (string= t "poco rall.")
             (string= t "poco rit."))
            (loop factor (cons e newelements) tail (cons 'pocoRall actions)))
@@ -477,25 +495,37 @@
             (make-music 'RestEvent 'duration (ly:make-duration len dots newnum 
newdenom))))))
          music)))
 
+       ((accel)
+       (set! ac:lastTempo ac:currentTempo)
+       (set! ac:currentTempo (ly:moment-div ac:currentTempo ac:rallFactor))
+       (let ((pset (ac:tempoChange ac:currentTempo)))
+        (if (null? (cdr actions))
+         (make-sequential-music (list pset music))
+         (make-sequential-music
+          (list pset (loop (cdr actions)))))))
+
+       ((pocoAccel)
+       (set! ac:lastTempo ac:currentTempo)
+       (set! ac:currentTempo (ly:moment-div ac:currentTempo ac:pocoRallFactor))
+       (let ((pset (ac:tempoChange ac:currentTempo)))
+        (if (null? (cdr actions))
+         (make-sequential-music (list pset music))
+         (make-sequential-music
+          (list pset (loop (cdr actions)))))))
+
        ((rall)
+       (set! ac:lastTempo ac:currentTempo)
        (set! ac:currentTempo (ly:moment-mul ac:currentTempo ac:rallFactor))
-       (let ((pset (make-music 'PropertySet
-          'value
-          ac:currentTempo
-          'symbol
-          'tempoWholesPerMinute)))
+       (let ((pset (ac:tempoChange ac:currentTempo)))
         (if (null? (cdr actions))
          (make-sequential-music (list pset music))
          (make-sequential-music
           (list pset (loop (cdr actions)))))))
 
        ((pocoRall)
+       (set! ac:lastTempo ac:currentTempo)
        (set! ac:currentTempo (ly:moment-mul ac:currentTempo ac:pocoRallFactor))
-       (let ((pset (make-music 'PropertySet
-          'value
-          ac:currentTempo
-          'symbol
-          'tempoWholesPerMinute)))
+       (let ((pset (ac:tempoChange ac:currentTempo)))
         (if (null? (cdr actions))
          (make-sequential-music (list pset music))
          (make-sequential-music
@@ -503,11 +533,8 @@
 
        ((aTempo)
        (set! ac:currentTempo ac:lastTempo)
-       (let ((pset (make-music 'PropertySet
-          'value
-          ac:currentTempo
-          'symbol
-          'tempoWholesPerMinute)))
+       
+       (let ((pset (ac:tempoChange ac:currentTempo)))
         (if (null? (cdr actions))
          (make-sequential-music (list pset music))
          (make-sequential-music
@@ -622,12 +649,12 @@
      (ac:adjust-props (ly:music-property music 'symbol) music)
      music)
 
-    (else  music))
+    (else music))
  ))
 
 
 
-% At last ... here's the music function that aplies all the above to a
+% At last ... here's the music function that applies all the above to a
 % score.
 articulate = #(define-music-function (parser location music)
               (ly:music?)


--
Dr Peter Chubb                                  peter.chubb AT nicta.com.au
http://www.ssrg.nicta.com.au          Software Systems Research Group/NICTA



reply via email to

[Prev in Thread] Current Thread [Next in Thread]