]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/midi.scm
* GNUmakefile.in (EXTRA_DIST_FILES): remove VIM stuff.
[lilypond.git] / scm / midi.scm
index 7167df899c8f2dcd9291a55d85af8854c3a4612d..b41308b77abda626c346f9df1800f60e233d7d19 100644 (file)
@@ -2,11 +2,17 @@
 ;;;
 ;;;  source file of the GNU LilyPond music typesetter
 ;;; 
-;;; (c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
+;;; (c)  2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
 
 
+
+;;;;;;;;;;;;;;;;;;
+;;; TODO:
+
+;; this is broken: we should not ever export variables from Scheme.
+
 ;; define factor of total volume per dynamic marking
-(define absolute-volume-alist '())
+(define-public absolute-volume-alist '())
 (set! absolute-volume-alist
       (append 
       '(
@@ -32,7 +38,7 @@
        (cdr entry))))
 
 ;; define factors of total volume of minimum and maximum volume
-(define instrument-equalizer-alist '())
+(define-public instrument-equalizer-alist '())
 (set! instrument-equalizer-alist
       (append 
        '(
          ("recorder" . ,(- 75 1))
          ("pan flute" . ,(- 76 1))
          ("blown bottle" . ,(- 77 1))
-         ("skakuhachi" . ,(- 78 1))
+         ("shakuhachi" . ,(- 78 1))
          ("whistle" . ,(- 79 1))
          ("ocarina" . ,(- 80 1))
 
@@ -260,8 +266,8 @@ returns whether the instrument should use midi channel 9
          (entry (assoc inst instrument-names-alist))
        )
      (and entry (>= (cdr entry) 32768))
-  )
-)
+  ))
+
 (define-public (midi-program instrument)
 "
 returns the program of the instrument
@@ -277,19 +283,6 @@ returns the program of the instrument
 ;; urg: we should set this at start of track
 (define-public dynamic-default-volume 0.71)
 
-(define-public (accidentals-in-key pitch-list)
+(define-public (alterations-in-key pitch-list)
   "Count number of sharps minus number of flats"
-  (apply + (map cdr pitch-list)))
-
-(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))))
-  )
+  (/ (apply + (map cdr pitch-list)) 2))