-(define-public (major-key pitch-list)
- "Characterise the key as major if the alteration of the
-third scale note is the same as that of the main note.
-Note: MIDI cannot handle other tonalities than major/minor.
-"
- ;; This charactersition is only true for a scale that starts at `c'.
- (if (not (equal? (car pitch-list) '(0 . 0)))
- (begin
- (ly:warn "Attempt to determine tonality of transposed scale")
- #t)
- (eq? (cdr (list-ref pitch-list 4)) (cdr (list-ref pitch-list 6)))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+
+(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))))))