X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fmidi.scm;h=70fa620bc0976ed21b91b6cbeac6b2c4975af2fb;hb=6ec966af050b25a860b1c3cd047a833ddd59f11e;hp=9cb0d89b1d0bd84889c95290f67ce8db6e1e7336;hpb=582f368c09121f2310f799fad2760a88d47a242a;p=lilypond.git diff --git a/scm/midi.scm b/scm/midi.scm index 9cb0d89b1d..70fa620bc0 100644 --- a/scm/midi.scm +++ b/scm/midi.scm @@ -1,10 +1,16 @@ -;;; midi.scm -- scm midi variables and functions -;;; -;;; source file of the GNU LilyPond music typesetter -;;; -;;; (c) 2000--2003 Jan Nieuwenhuizen +;;;; midi.scm -- scm midi variables and functions +;;;; +;;;; source file of the GNU LilyPond music typesetter +;;;; +;;;; (c) 2000--2005 Jan Nieuwenhuizen + +;;;;;;;;;;;;;;;;;; +;;; TODO: + +;; this is broken: we should not ever export variables from Scheme. + ;; define factor of total volume per dynamic marking (define-public absolute-volume-alist '()) (set! absolute-volume-alist @@ -36,7 +42,7 @@ (set! instrument-equalizer-alist (append '( - ("flute" . (0 . 0.07)) + ("flute" . (0 . 0.7)) ("oboe" . (0 . 0.7)) ("clarinet" . (0 . 0.7)) ("bassoon" . (0 . 0.6)) @@ -50,7 +56,7 @@ ) instrument-equalizer-alist)) -;; (name . program+32768*(channel10 ? 1 : 0) ) +;; (name . program+32768*(channel10 ? 1 : 0)) (define instrument-names-alist '()) (set! instrument-names-alist (append @@ -150,7 +156,7 @@ ("recorder" . ,(- 75 1)) ("pan flute" . ,(- 76 1)) ("blown bottle" . ,(- 77 1)) - ("skakuhachi" . ,(- 78 1)) + ("shakuhachi" . ,(- 78 1)) ("whistle" . ,(- 79 1)) ("ocarina" . ,(- 80 1)) @@ -240,43 +246,34 @@ ("mt-32 drums" . ,(+ 32768 127)) ("cm-64 kit" . ,(+ 32768 127)) ("cm-64 drums" . ,(+ 32768 127)) - ) - instrument-names-alist - ) -) - + ) + instrument-names-alist)) (define-public (default-instrument-equalizer s) (let ((entry (assoc s instrument-equalizer-alist))) (if entry (cdr entry)))) - (define-public (percussion? instrument) " returns whether the instrument should use midi channel 9 " (let* ((inst (symbol->string instrument)) - (entry (assoc inst instrument-names-alist)) - ) - (and entry (>= (cdr entry) 32768)) - ) -) + (entry (assoc inst instrument-names-alist))) + (and entry (>= (cdr entry) 32768)))) + (define-public (midi-program instrument) " returns the program of the instrument " (let* ((inst (symbol->string instrument)) - (entry (assoc inst instrument-names-alist)) - ) - (if entry (modulo (cdr entry) 32768) #f ) - ) -) + (entry (assoc inst instrument-names-alist))) + (if entry (modulo (cdr entry) 32768) #f))) ;; 90 == 90/127 == 0.71 is supposed to be the default value ;; 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))) + (/ (apply + (map cdr pitch-list)) 2))