]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/midi.scm
Docs makefiles: get rid of unconditional translations postprocessing
[lilypond.git] / scm / midi.scm
index ca26e2dfb1780a4a61cd39dc419544a6ff5d997b..68352456b2df41222e895df630968b7599d1cd4c 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 2000--2009 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))
 
          ("electric guitar (muted)" . ,(- 29 1))
          ("overdriven guitar" . ,(- 30 1))
          ("distorted guitar" . ,(- 31 1))
-         ("guitar harmo(dinics" . ,(- 32 1))
+         ("guitar harmonics" . ,(- 32 1))
 
          ; (33-40 bass)
          ("acoustic bass" . ,(- 33 1))
@@ -276,4 +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 (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)))))))