X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fmidi.scm;h=715c8c0e37fc8fa1ddf2d32fb9bfae90f188069e;hb=8b99c4145987f5b682f8b708849c4df87acd5949;hp=4180f1b517d294ce135e994c4d61ff0cd1fcd030;hpb=dd059e31c04c25120dbdc7c45822b19c800d9aca;p=lilypond.git diff --git a/scm/midi.scm b/scm/midi.scm index 4180f1b517..715c8c0e37 100644 --- a/scm/midi.scm +++ b/scm/midi.scm @@ -2,7 +2,7 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 2000--2005 Jan Nieuwenhuizen +;;;; (c) 2000--2007 Jan Nieuwenhuizen @@ -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))))))