]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/midi.scm
Merge with master
[lilypond.git] / scm / midi.scm
index ca26e2dfb1780a4a61cd39dc419544a6ff5d997b..cef0fae28b07d31369ec4860f2eae14120131f43 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 
 
 
@@ -28,7 +28,7 @@
        ("pp" . 0.49)
        ("ppp" . 0.42)
        ("pppp" . 0.34)
-       ("ppppp" . 0.25)        )
+       ("ppppp" . 0.25)
        )
       absolute-volume-alist))
 
@@ -276,4 +276,26 @@ returns the program of the instrument
 
 (define-public (alterations-in-key pitch-list)
   "Count number of sharps minus number of flats"
-  (/ (apply + (map cdr pitch-list)) 2))
+  
+  (* (apply + (map cdr pitch-list)) 2))
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+
+(define-public (write-performances-midis performances basename)
+  (let
+      loop
+    ((perfs performances)
+     (count 0))
+
+
+    (if (pair?  perfs)
+       (begin
+         (ly:performance-write
+          (car perfs)
+          (if (> count 0)
+              (format #f "~a-~a.midi" basename count)
+              (format #f "~a.midi" basename)))
+         (loop (cdr perfs) (1+ count))))))