]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/midi.scm
Run `make grand-replace'.
[lilypond.git] / scm / midi.scm
index dee999868e7a22f2eaf1a5699d8fa2878931827a..9a7bcb5e68492f981dea1e01046ae77b178bd0e4 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 2000--2008 Jan Nieuwenhuizen <janneke@gnu.org>
 
 
 
@@ -276,25 +276,25 @@ 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 (paper-book-write-midis paper-book basename)
-  (let
-      loop
-    ((perfs (ly:paper-book-performances paper-book))
-     (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))))))
+(define-public (write-performances-midis performances basename . rest)
+  (let ((midi-ext (ly:get-option 'midi-extension)))
+    (let
+       loop
+      ((perfs performances)
+       (count (if (null? rest) 0 (car rest))))
+      (if (pair?  perfs)
+         (begin
+           (ly:performance-write
+            (car perfs)
+            (if (> count 0)
+                (format #f "~a-~a.~a" basename count midi-ext)
+                (format #f "~a.~a" basename midi-ext)))
+           (loop (cdr perfs) (1+ count)))))))